Author Topic: How to change the "wxWidgets library settings" in a created project?  (Read 6117 times)

Offline 00061205

  • Multiple posting newcomer
  • *
  • Posts: 30
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?

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #1 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".
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline 00061205

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #2 on: July 22, 2008, 05:08:12 am »
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

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #3 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.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline 00061205

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #4 on: July 23, 2008, 04:57:00 am »
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.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #5 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.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline pasgui

  • Almost regular
  • **
  • Posts: 165
    • LGP
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #6 on: July 23, 2008, 10:51:33 am »
I think wx-config for windows can manage the declaration like under linux.

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #7 on: July 23, 2008, 11:34:07 am »
looks nice  :P
Did you try it ?

Offline pasgui

  • Almost regular
  • **
  • Posts: 165
    • LGP
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #8 on: July 23, 2008, 01:39:06 pm »
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.

Offline 00061205

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #9 on: July 24, 2008, 04:10:36 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?

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #10 on: July 24, 2008, 04:36:17 am »
You can't; thus the need to add all these additional libraries by hand. See above re: facts of life.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #11 on: July 24, 2008, 06:21:34 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.

Offline 00061205

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #12 on: July 24, 2008, 07:39:58 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

« Last Edit: July 24, 2008, 07:42:13 am by 00061205 »

Offline 00061205

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #13 on: July 24, 2008, 08:09:35 am »
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.
« Last Edit: July 24, 2008, 08:12:21 am by 00061205 »

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: How to change the "wxWidgets library settings" in a created project?
« Reply #14 on: July 24, 2008, 09:34:10 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.