User forums > Help

How to setup wxwidgets in code::blocks Linux

(1/6) > >>

rowck001:
Ok - I switched to Linux   8) (I have DialogBlocks and wxWidgets installed)

How do I set up the code::blocks environment to use this library in Linux??

I installed as root for make install in wxwidgets complie - so I assume it went into /usr/local/share

yop:
Open up a console and type:

--- Code: ---wx-config --version
--- End code ---
If you see something as an output then we 're on the right track.
To your project now:
Project->Build Options->Compiler->Other Options add `wx-config --cflags` in there
Project->Build Options->Linker->Other Options add `wx-config --libs` in there
One final thing (don't know if this one is fixed). There is a bug that won't let the linker options work correctly so also do the following:
Project->Properties->Generate pch in a directory alongside... (the first option from above)
Enjoy...

P.S. what linux distro are you using? You don't *really* need to build wxWidgets from source, installing wxGTK from your distro's repository should be enough.

rowck001:
Thanks for the help

I am using Ubuntu Breezy and using its wxlibs deb packages doesnt give me the wxgtk....so.0 lib file so thats why I built from source

Incidently, should I have compiled as monolithic or shared library?

yop:
Generally prefer shared libraries. I don't really like the monolithic build, but I can understand the purpose of it in windows. In linux you can choose to go either way. If you want to get the C::B proposed build just take a look at the wiki.

rowck001:
Thanks for the help yop - but it doesnt work - after putting in the options you specified i still get this output from anf wxwidgets project:

Compiling: main.cpp
g++: `wx-config: No such file or directory
g++: `wx-config: No such file or directory
cc1plus: error: unrecognized command line option "-fcflags`"
cc1plus: error: unrecognized command line option "-fcflags`"
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

wxwidgets works like a charm in kdevelop (straight out of the box) but not code::blocks

probably not a good idea to sprout code::blocks as cross-platform as it clearly doesnt work apart from trivial console applications in linux!

Navigation

[0] Message Index

[#] Next page

Go to full version