User forums > Using Code::Blocks
Linux with wxwidgets gtk undefined reference
mimosa:
1) I added `wx-config --libs std aui propgrid` and it didn't work
2) I restarted code::blocks (after adding `wx-config --libs std aui propgrid`) and it didn't work
3) I added `pkg-config --libs gtk+-2.0` and it didn't work
4) I restarted code::blocks (after adding `pkg-config --libs gtk+-2.0`) and it didn't work
still no solution. I cannot compile a project with wxwidgets 3.0.1 in codeblocks under linux 64. If it works for you, tell me what you do (in the compile, linker, C::B options, or if you had to install extra packages in your machine)
Jenna:
The pkg-config-stuff is not needed, unless you use gtk2 libs yourself.
By the way, it should be gtk3, as you build your wx against it.
I just tested your wx-configuration with wx-trunk (about tone or twoweeks old) and the default wx-project, same settings as you used and there are no issues.
The only diference is, that it is wx3.1 and a local build below my home-folder without running make install, so I have to use the absolute path for wx-config.
And I do not have the global variable wx set, but it is not used at all, so this should not make any difference.
Fedora 20, 64 bit, g++ 4.8.3
cacb:
--- Quote from: mimosa on September 12, 2014, 09:50:51 am ---1) I added `wx-config --libs std aui propgrid` and it didn't work
2) I restarted code::blocks (after adding `wx-config --libs std aui propgrid`) and it didn't work
3) I added `pkg-config --libs gtk+-2.0` and it didn't work
4) I restarted code::blocks (after adding `pkg-config --libs gtk+-2.0`) and it didn't work
still no solution. I cannot compile a project with wxwidgets 3.0.1 in codeblocks under linux 64. If it works for you, tell me what you do (in the compile, linker, C::B options, or if you had to install extra packages in your machine)
--- End quote ---
I use static library build of wx 3.0.1 under linux Kubuntu 14.04 (and also raspbian). From a typical project file (console app project):
<Target title="GCC_Release">
<Option output=".cmp/gcc/bin/Release/raspimeter" prefix_auto="1" extension_auto="1" />
<Option object_output=".cmp/gcc/obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Option projectLinkerOptionsRelation="2" />
<Compiler>
<Add option="-Os" />
<Add option="-std=c++0x" />
<Add option="-W" />
<Add option="-fPIC" />
<Add option="-fexceptions" />
<Add option="`$(#wx.config) --cxxflags`" />
<Add option="-DNOPCH" />
</Compiler>
<Linker>
<Add option="`$(#wx.config) --libs std,aui --static`" />
</Linker>
</Target>
'wx' is a C::B global variable with a user defined field 'config'.
wx.base = /usr/local
wx.config = /usr/local/bin/wx-config --version=3.0 --toolkit=gtk2
This works fine here.
mimosa:
OK, I have something interesting. I deleted ~/.codeblocks/default.conf and restarted C::B and it's all good. (if you do this, you should delete the ~/.codeblocks/default.conf from you as a user, and/or as root depending from which user you launch C::B, I just deleted both the ~/.codeblocks/default.conf from me as user and from the root).
Good, now I am back into coding! Great! Thanks a lot guys!
Navigation
[0] Message Index
[*] Previous page
Go to full version