User forums > Using Code::Blocks
Does C::B statically link wxWidgets?
(1/1)
Sledgehammer_999:
First of all I must say that I am quite new in programming especially on linux.
I have a simple question. Let's say I compile the example wxwidgets project provided by the corresponding wizard. How does it link with wxWidgets? Dynamically or Statically? If, it links dynamically can you tell me how to link it statically?
I am using nightly build 4681 on Ubuntu 7.10 amd64 and wxWidgets 2.8.6.
Thank you.
Sledgehammer_999:
Well, I found the answers to my questions.
First of all, by default C::B on Ubuntu doesn't link statically the projects you make.
Secondly to do that, you have to build wxWidgets with "static" support. You do that by:
--- Code: ---./configure --disable-shared
--- End code ---
Look in the INSTALL file for more details and more options on "static" build. The good thing is that different builds of wxWidgets can co-exist.
Now for C::B to statically link wxWidgets for your projects you have to do this(I am refering to the nightly builds of C::B).
1. Create your project. Let's name it "hello"
2. Choose Project->Build Options...
3. From the list on the left choose the "hello" item.
4. In the "Compiler Settings" tab choose the "Other Options" tab
5. Replace `wx-config --cflags` with `wx-config --static=yes --cflags`
6. In the "Linker Settings" tab in the "Other Linker Options:" list replace `wx-config --libs` with `wx-config --static=yes --libs`
Navigation
[0] Message Index
Go to full version