Author Topic: Does C::B statically link wxWidgets?  (Read 3132 times)

Offline Sledgehammer_999

  • Single posting newcomer
  • *
  • Posts: 4
Does C::B statically link wxWidgets?
« on: December 02, 2007, 10:05:31 pm »
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.

Offline Sledgehammer_999

  • Single posting newcomer
  • *
  • Posts: 4
Re: Does C::B statically link wxWidgets?
« Reply #1 on: December 03, 2007, 06:16:44 pm »
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

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`