Author Topic: -fontconfig ????  (Read 6633 times)

Offline Papito

  • Multiple posting newcomer
  • *
  • Posts: 13
-fontconfig ????
« on: November 25, 2008, 04:48:00 am »
I have an application that used to compile perfectly when I ported from the old c::b version to the new version, but when I decided to recreate the entire project using the new version of C::B I get an linking error that reads:

cannot find -lfontconfig

What is so strange is that I am not using -lfontconfig, below are the parameters that I am using to compile this gtkmm program:

CFLAGS
~~~~~~
-mms-bitfields -ID:/XWin/include/gtkmm-2.4 -ID:/XWin/lib/gtkmm-2.4/include -ID:/XWin/include/glibmm-2.4 -ID:/XWin/lib/glibmm-2.4/include -ID:/XWin/include/giomm-2.4 -ID:/XWin/lib/giomm-2.4/include -ID:/XWin/include/gdkmm-2.4 -ID:/XWin/lib/gdkmm-2.4/include -ID:/XWin/include/pangomm-1.4 -ID:/XWin/include/atkmm-1.6 -ID:/XWin/include/gtk-2.0 -ID:/XWin/include/sigc++-2.0 -ID:/XWin/lib/sigc++-2.0/include -ID:/XWin/include/glib-2.0 -ID:/XWin/lib/glib-2.0/include -ID:/XWin/lib/gtk-2.0/include -ID:/XWin/include/cairomm-1.0 -ID:/XWin/include/pango-1.0 -ID:/XWin/include/cairo -ID:/XWin/include/libpng12 -ID:/XWin/include/atk-1.0 


LIBS
~~~~
-LD:/XWin/lib -lgtkmm-2.4 -lgiomm-2.4 -lgdkmm-2.4 -latkmm-1.6 -lgtk-win32-2.0 -lpangomm-1.4 -lcairomm-1.0 -lglibmm-2.4 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl

Can anyone explain to me why this is happening, is this a virus or is it a bug in C::B?

TIA

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6538
    • My Best Post
Re: -fontconfig ????
« Reply #1 on: November 25, 2008, 05:37:35 am »
1. Turn on full compiler logging to verify the problem.
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

2. After problem is confirmed, I would use an Text Editor to edit the cbp file to find the problem and fix it. Note, if you do not know the difference between Word Processor and Text Editor do not do this step.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9493
Re: -fontconfig ????
« Reply #2 on: November 25, 2008, 09:27:27 am »
Can anyone explain to me why this is happening, is this a virus or is it a bug in C::B?
Most likely a virus... Harharhar... :lol:

Honestly:
Check the following build options in your project file:
1.) Project level: Tab "Linker settings" -> "Link libraries", "Other linker options"
2.) Target level: Tab "Linker settings" -> "Link libraries", "Other linker options"
3.) Project level: Tab "Compiler settings" -> "Other options"
4.) Target level: Tab "Compiler settings" -> "Other options"

"fontconfig" will be in one of these settings.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9493
Re: -fontconfig ????
« Reply #3 on: November 25, 2008, 09:28:37 am »
2. After problem is confirmed, I would use an Text Editor to edit the cbp file to find the problem and fix it.
You better don't. This will be the root of even more trouble. There are NO settings hidden in the project file. All settings from the project file can be edited via C:B.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Papito

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: -fontconfig ????
« Reply #4 on: November 26, 2008, 01:53:39 pm »
Ok, there seems to be a lot of problems for me to follow your suggestions, so, what I will do is explain to you what I am doing at my end as detailed as possible, in the hope that from there you will be able to see what I am doing wrong.

First I will recreate the project
Start Code::Blocks
Click on "Create a new project"
Select "console application"
Select "c++"
name the application "tst"
Select "Create debug configuration"
<bin\Debug>
<obj\Debug>
Select "Create release configuration"
<bin\Release>
<obj\Release>
Click on "Finish"
I then add all the needed files in the project and marked them as debug as the target they should all belong to.

Second I will extract the pkg-config parameters

Using the Prompt, I type:
$> pkg-config gtkmm-2.4 --cflags > cflag_parameters.txt
$> pkg-config gtkmm-2.4 --libs > libs_parameters.txt

The values, or parameters, in the two above text files are:

CFLAGS
~~~~~~
-mms-bitfields -ID:/XWin/include/gtkmm-2.4 -ID:/XWin/lib/gtkmm-2.4/include -ID:/XWin/include/glibmm-2.4 -ID:/XWin/lib/glibmm-2.4/include -ID:/XWin/include/giomm-2.4 -ID:/XWin/lib/giomm-2.4/include -ID:/XWin/include/gdkmm-2.4 -ID:/XWin/lib/gdkmm-2.4/include -ID:/XWin/include/pangomm-1.4 -ID:/XWin/include/atkmm-1.6 -ID:/XWin/include/gtk-2.0 -ID:/XWin/include/sigc++-2.0 -ID:/XWin/lib/sigc++-2.0/include -ID:/XWin/include/glib-2.0 -ID:/XWin/lib/glib-2.0/include -ID:/XWin/lib/gtk-2.0/include -ID:/XWin/include/cairomm-1.0 -ID:/XWin/include/pango-1.0 -ID:/XWin/include/cairo -ID:/XWin/include/libpng12 -ID:/XWin/include/atk-1.0

LIBS
~~~~
-LD:/XWin/lib -lgtkmm-2.4 -lgiomm-2.4 -lgdkmm-2.4 -latkmm-1.6 -lgtk-win32-2.0 -lpangomm-1.4 -lcairomm-1.0 -lglibmm-2.4 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl
I am not sure if what I am doing is right, but I would really appreciate some help.

Please note that there is no '-lfontconfig'


third add the parameters to c::b

I then copy the content in the cflags_parameters.txt to Code::Blocks, as follows:
   Project->Building Options->Compiler Settings->'Other Options' tab

And the content of the libs_paramenters.txt as follows
   Project->Building Options->Linker Settings->'Other Linker Options' box

--------------------
What is wrong in what I'm doing? why the -lfontconfig linking error?

TIA

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: -fontconfig ????
« Reply #5 on: November 26, 2008, 02:24:10 pm »
As Tim posted before:
please turn on full commandline logging:

Change "Settings -> Compiler and debugger... -> Global compiler settings -> Other settings(rightmost tab)" "Compiler logging" to "Full commandline", and post the relevant content f the build log.

Btw: are there any settings in "Settings -> Compiler and Debugger... -> Global compiler settings -> Compiler settings" and "... -> Linker settings" ?

Offline Papito

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: -fontconfig ????
« Reply #6 on: November 26, 2008, 03:44:39 pm »
Oops sorry, you are absolutely right, here is the info. you requested.
Please, do keep in mind that I have NEVER included -lfontconfig in the linker parameters.
Also, please note that the issue here is not that I don't understand the problem, the issue here is that there is no reason for this problem to exist; because I never added the parameter the linker complains about.

I would also like to thank you for your prompt and efficient response to my questions, keep up the good work folks!
-------------- Build: Debug in Samiira ---------------

g++.exe  -o bin\Debug\Samiira.exe obj\Debug\addressframe.o obj\Debug\combo.o obj\Debug\contacts.o obj\Debug\entry.o obj\Debug\jaime.o obj\Debug\jme\address\address.o obj\Debug\jme\date\date.o obj\Debug\jme\email\email.o obj\Debug\jme\exception\exception.o obj\Debug\jme\gnu_io\gnu_io.o obj\Debug\jme\io_base\io_base.o obj\Debug\jme\name\name.o obj\Debug\jme\person\person.o obj\Debug\jme\phone\phone.o obj\Debug\jme\strtools\strtools.o obj\Debug\jme\url\url.o obj\Debug\main.o obj\Debug\nameframe.o obj\Debug\phoneframe.o   -LD:/XWin/lib -lgtkmm-2.4 -lgiomm-2.4 -lgdkmm-2.4 -latkmm-1.6 -lgtk-win32-2.0 -lpangomm-1.4 -lcairomm-1.0 -lglibmm-2.4 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -pg -lgmon -user32 -Wl,-luuid -LD:/XWin/lib -lgtkmm-2.4 -lgdkmm-2.4 -latkmm-1.6 -lgtk-win32-2.0 -lpangomm-1.4 -lcairomm-1.0 -lglibmm-2.4 -lsigc-2.0 -lgdk-win32-2.0 -lgdi32 -limm32 -lshell32 -lole32 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lfontconfig -lfreetype -lz -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv 
D:\XWin\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lfontconfig
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 19 seconds)
1 errors, 0 warnings

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6538
    • My Best Post
Re: -fontconfig ????
« Reply #7 on: November 26, 2008, 03:55:15 pm »
Run this command on the command line.
pkg-config --libs gtk+-2.0

Does it have the library listed?
If yes, you need to fix your GTK+ installation.
Note: The above command was copied from the Code::Blocks Debug extra settings.
Tim S
« Last Edit: November 26, 2008, 03:57:37 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: -fontconfig ????
« Reply #8 on: November 26, 2008, 04:08:16 pm »
And once again:
Btw: are there any settings in "Settings -> Compiler and Debugger... -> Global compiler settings -> Compiler settings" and "... -> Linker settings" ?

in other words, do you have any global compiler settings, that interfer with your projects build options.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6538
    • My Best Post
Re: -fontconfig ????
« Reply #9 on: November 26, 2008, 04:14:41 pm »
FYI:

pkg-config --libs gtk+-2.0

returns this on Cygwin I have GTK+ installed

Code: [Select]
-L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangoxft-1.0 -lXft -lfreetype -lz -lXrender -lXext -lfontconfig -lpangox-1.0 -lX11 -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv

I say it is an bad GTK+ Setup. Or the user should not be using GTK+

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Papito

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: -fontconfig ????
« Reply #10 on: November 26, 2008, 04:24:33 pm »

These are the parameters returned:

-LD:/XWin/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl 

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9493
Re: -fontconfig ????
« Reply #11 on: November 26, 2008, 04:28:35 pm »
These are the parameters returned:
Please answer Jens' question. This is most likely the solution to your your problem.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Papito

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: -fontconfig ????
« Reply #12 on: November 26, 2008, 04:57:36 pm »
He asked me to check what was the output of:

pkg-config --libs gtk+-2.0

I did, and the output is:

-LD:/XWin/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl 


Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: -fontconfig ????
« Reply #13 on: November 26, 2008, 06:14:37 pm »
He asked me to check what was the output of:

pkg-config --libs gtk+-2.0

I did, and the output is:

-LD:/XWin/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl 


That's not right.
And once again:
Btw: are there any settings in "Settings -> Compiler and Debugger... -> Global compiler settings -> Compiler settings" and "... -> Linker settings" ?

in other words, do you have any global compiler settings, that interfer with your projects build options.

Please read the posts exactly.
If you are not able to do that, or you are not willing to do so, we can not help you.

Offline Papito

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: -fontconfig ????
« Reply #14 on: November 26, 2008, 06:50:08 pm »
Yap! the problem was in the global parameters.
I must've done this a long time ago, so long ago was this that I don't remember making this changes.

Thanks folks!