Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I'm just testing gtk in codeblocks, i downloaded the libraries from: Static GTK+3 for Windows | Tarnyko.net, serious side[^]

i added all the includes paths for mingw and gtk all the libs paths and i added all gtk static libs in the project options.

but i still get cannot find -lgtk-3 -lgobject-2.0 -lglib-2.0

Problem in Code::blocks Screen Shot[^]

how do i fix that?

What I have tried:

I have tried to remove them from the linked libraries tab, but then I get undefined references to some functions like gtk_init etc...
Posted
Updated 23-Apr-18 21:45pm
v2

Those are linker messages telling you that the linker does not know where those library files are stored. You need to add some option with the name of the library directory so it can find them. I don't know what that option might be as I have never used code::blocks, but I would expect the documentation to explain it.
 
Share this answer
 
You have to tell the linker where to search for libraries. This can be either done by adding the path(es) to the environment variable LIBRARY_PATH or by passing them on the command line using the -L<dir> option. I have not used CodeBlocks so far but there should be an option for those pathes (globally or project specific).

I also don't know how CodeBlocks handles linking of static libraries. There is the linker option -Wl,-Bstatic which enables static linking of all libraries. If only specific libraries should be statically linked, they must be passed with -l:<libname.ext>. Note that the fullname with extension must be passed (e.g. -l:libgtk-3.a instead of -lgtk-3 for Linux; for Windows it is probably the .lib extension).

In any case you should check the full linker command line and if the files exist in a directory that the linker searches for libraries.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900