News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

How to change the "wxWidgets library settings" in a created project?

Started by 00061205, July 21, 2008, 09:32:14 AM

Previous topic - Next topic

00061205

I checked the "use wxWidgets dll" option when I create my project. However, now I want to link my app to a static library. What I should do?

TDragon

1. If you aren't using wxPack, ensure that you've built wxWidgets as a static library (SHARED=0).
2. In the Linker search directories of your project's Build options, alter the path ending in "gcc_dll" to end in "gcc_lib".
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

00061205

Quote from: TDragon on July 21, 2008, 05:05:45 PM
1. If you aren't using wxPack, ensure that you've built wxWidgets as a static library (SHARED=0).
2. In the Linker search directories of your project's Build options, alter the path ending in "gcc_dll" to end in "gcc_lib".
Yes, I'm using wxPack. However, after I alter the gcc_dll to end in gcc_lib the project can't compile successfully

TDragon

Ah yes, I forgot that there are additional libraries that need to be brought in.
Try adding the following (to the Link libraries list under the Linker settings tab):
libwxpng.a
libwxzlib.a
libkernel32.a
libuser32.a
libgdi32.a
libwinspool.a
libcomdlg32.a
libadvapi32.a
libshell32.a
libole32.a
liboleaut32.a
libuuid.a
libcomctl32.a
libwsock32.a
libodbc32.a

These are the libraries that normally get brought in when the DLL is created, but which you have to bring in yourself when using the non-DLL version.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

00061205

Quote from: TDragon on July 22, 2008, 04:53:41 PM
Ah yes, I forgot that there are additional libraries that need to be brought in.
Try adding the following (to the Link libraries list under the Linker settings tab):
libwxpng.a
libwxzlib.a
libkernel32.a
libuser32.a
libgdi32.a
libwinspool.a
libcomdlg32.a
libadvapi32.a
libshell32.a
libole32.a
liboleaut32.a
libuuid.a
libcomctl32.a
libwsock32.a
libodbc32.a

These are the libraries that normally get brought in when the DLL is created, but which you have to bring in yourself when using the non-DLL version.
wow! So complicated. Maybe the developers could improve that in the next nighty build.

TDragon

This has nothing to do with Code::Blocks; it's just a fact of life when working with libraries in C/C++.

In fact, if you re-run the wxWidgets project wizard and select a non-DLL build, Code::Blocks will fill in these additional libraries for you; I merely copied them.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

pasgui


dje


pasgui

Quote from: dje on July 23, 2008, 11:34:07 AM
Did you try it ?
Yes, I don't remember if it was with static or dynamic wxWidgets library but under C::B, you can configure your project for Linux and Windows, only add in the variables definition, the path for the executable and some environment variable needed for wx-config.

00061205

Quote from: TDragon on July 23, 2008, 08:23:27 AM
This has nothing to do with Code::Blocks; it's just a fact of life when working with libraries in C/C++.

In fact, if you re-run the wxWidgets project wizard and select a non-DLL build, Code::Blocks will fill in these additional libraries for you; I merely copied them.
How to re-run the wxWidgets project wizard without overwrite my project?

TDragon

You can't; thus the need to add all these additional libraries by hand. See above re: facts of life.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Biplab

Quote from: 00061205 on July 24, 2008, 04:10:36 AM
How to re-run the wxWidgets project wizard without overwrite my project?

1) Open the project.
2) File > New > Build Target...
3) Select wxWidgets and follow the steps.

Please note that this will work if you don't change your project compiler.
Be a part of the solution, not a part of the problem.

00061205

Quote from: Biplab on July 24, 2008, 06:21:34 AM
Quote from: 00061205 on July 24, 2008, 04:10:36 AM
How to re-run the wxWidgets project wizard without overwrite my project?

1) Open the project.
2) File > New > Build Target...
3) Select wxWidgets and follow the steps.

Please note that this will work if you don't change your project compiler.
This method doesn't work. A lot of link errors show up. The libs must be add manually after re-run the wxWidgets project.
libwxpng.a
libwxzlib.a
libkernel32.a
libuser32.a
libgdi32.a
libwinspool.a
libcomdlg32.a
libadvapi32.a
libshell32.a
libole32.a
liboleaut32.a
libuuid.a
libcomctl32.a
libwsock32.a
libodbc32.a


00061205

I found a way to solve this problem.
Open your project and then:
1.file->new->project
2.select wxWidgets project. next->next->next->next->next->next
3.uncheck the "Use wxWidgets DLL";check the "Create Empty Project"
4.right click the project name in management->projects windows->add files
4.add all source files.
6.build project.

Biplab

Quote from: 00061205 on July 24, 2008, 07:39:58 AM
This method doesn't work. A lot of link errors show up. The libs must be add manually after re-run the wxWidgets project.

You've found a bug. A refactoring of wxWidgets wizard is necessary.
Be a part of the solution, not a part of the problem.