Code::Blocks Forums

User forums => Help => Topic started by: mpmfs on January 21, 2006, 04:04:58 pm

Title: (wxwidgets) one big exe-file instead of exe and dll files
Post by: mpmfs on January 21, 2006, 04:04:58 pm
Hi folks,
i have read some forum-topics and i am very confused using static or dynamic library :shock:
(please keep in mind, when you're reading my post, that i am a newbie using wxWidgets  :oops: )

first:
--> i was able to compile the wxmsw26_gcc_cb.dll with mingw32-make  :lol:

Question 1:
--> i want to give my finished wxWidgets exe-file to friends WITHOUT the wxmsw26_gcc_cb.dll. Is it possible? In other words: Is it possible to "include" the libraries by unsing CB-template #b (see below)??? :oops:

Question 2:

In Code::Blocks I find two templetes:
(a) using wxWidgets DLL
     ~> Projects with this template are working fine  :)

BUT the template:
(b) using static wxWidgets library
     isn't working. (errror-message: ld.exe -enable-auto-import)

sorry for my bad english...

CU
Mike
Title: Re: (wxwidgets) one big exe-file instead of exe and dll files
Post by: takeshimiya on January 21, 2006, 04:17:25 pm
You need to recompile wxWidgets as a static library then.

Steps:

1) Throw away everything you've done :lol:
2) Recompile wxWidgets as a static library:
Code
mingw32-make -f makefile.gcc SHARED=0 RUNTIME_LIBS=static MONOLITHIC=1 BUILD=release UNICODE=0
3) Now you can use the C::B template with the fresh compiled static wxWidgets library.

Explanation:
Using SHARED=0 means that the wxWidgets library will be compiled as a static library.
Using RUNTIME_LIBS=static (instead of RUNTIME_LIBS=dynamic) links with the C runtime library as a static library.

Alert: Never compile a SHARED=1 with RUNTIME_LIBS=static. Evil things will happen. :lol:
Title: Re: (wxwidgets) one big exe-file instead of exe and dll files
Post by: tiwag on January 21, 2006, 04:37:19 pm
no need to throw away anything - static and shared versions can coexist in parallel on your harddisk,
then you've the freedom of selecting, which version you want to use for your project.

please keep in mind,
that building (especially linking) is much faster using the shared wxwidgets library than using the static libs.

so it's often appreciated, that you do your development with the shared wx-libs, and when you're finished
and want to deploy your application, build it using the static wx-libs in order to get an independent executable.

read your <wx-widgets-path>\install-msw.txt, there you can find any necessary information.
Title: Re: (wxwidgets) one big exe-file instead of exe and dll files
Post by: takeshimiya on January 21, 2006, 04:55:09 pm
Well, mpmfs wanted to get rid of the dll, so keeping it is useless, and only will confuse and waste space.  :P
You can also do a lot more things like cross-compile wxWidgets, but for someone that's starting, there is no need to do that.
Title: Re: (wxwidgets) one big exe-file instead of exe and dll files
Post by: mpmfs on January 21, 2006, 05:15:11 pm
thanks a lot.. now its working fine  :D

an install-text-file?!... oops. :oops:. i will have a look