Author Topic: How to use both Debug and Release builds of wx libraries?  (Read 4383 times)

Offline zorro

  • Single posting newcomer
  • *
  • Posts: 8
How to use both Debug and Release builds of wx libraries?
« on: December 07, 2006, 09:03:09 am »
I've followed the instructions on wiki.wxwidgets.org for building both Debug and Release libraries for wx. The (dynamic) libraries for both versions are located in the same gcc_dll directory. According to wiki.wxwidgets.org you should rename these gcc_dlls in order to have several builds.
But how do I tell C::B that for a debug version of my application, wx-libraries are located in gcc_dll_debug and for a release version in gcc_dll_release? I'm using the latest nightly built of C::B.

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: How to use both Debug and Release builds of wx libraries?
« Reply #1 on: December 07, 2006, 09:32:11 am »
Hi !!

The solution is in the Build options.

- Click on the project on the tree.
- Click on the Directories tabs then on the linker tab
- Put all target independant lib directories
- Click on the debug target
- Put gcc_dll_debug dir
- Click on the release target
- Put gcc_dll_release dir

You may use custom variables too and set usage at project level:
For my plugin, I use the dir $(#wx.lib)\gcc_dll$(WX_CFG)
I set the values on the "custom variables tab"
WX_CFG =

Dje

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6677
    • My Best Post
Re: How to use both Debug and Release builds of wx libraries?
« Reply #2 on: December 07, 2006, 10:15:28 am »
I've followed the instructions on wiki.wxwidgets.org for building both Debug and Release libraries for wx. The (dynamic) libraries for both versions are located in the same gcc_dll directory. According to wiki.wxwidgets.org you should rename these gcc_dlls in order to have several builds.
But how do I tell C::B that for a debug version of my application, wx-libraries are located in gcc_dll_debug and for a release version in gcc_dll_release? I'm using the latest nightly built of C::B.

I would use the default method of doing it and the default folder naming.

Using these C::B custom varibles
WX_SUFFIX=""  // ANSI Release
WX_SUFFIX="d"  // ANSI Debug
WX_SUFFIX="u"  // Unicode Release
WX_SUFFIX="ud"  // Unicode debug

I use WX_CFG when I am using a special configuration
WX_CFG="rc3"

Remember WX needs to point to the wxWidgets folder.

Example minGW build command for "Unicode debug" 2.8.0 RC3

mingw32-make -f makefile.gcc VENDOR=rc3 CFG=rc3 USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug   UNICODE=1

Note: vendor just puts rc3 in the DLL name; CFG sets which folder the DLL is placed in.
In this case in lib\gcc_dllrc3

Note: Before using CFG in the mingw32-make build you need to build with using it; else the build errors out.

Note: __WXDEBUG__ must be defined (in the codeblocks project setting) if your wish to link against the  debug version of wxWidgets DLL. Else you will get a runtime error, when you try to run your project output.

Tim S


« Last Edit: December 07, 2006, 11:26:35 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2180
Re: How to use both Debug and Release builds of wx libraries?
« Reply #3 on: December 07, 2006, 02:23:12 pm »
Note: Before using CFG in the mingw32-make build you need to build with using it; else the build errors out.

Nice explanation. But...

What do you mean by the above quote? Did you mean " Before using CFG in the project, you need to ..." ??

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6677
    • My Best Post
Re: How to use both Debug and Release builds of wx libraries?
« Reply #4 on: December 07, 2006, 03:00:59 pm »
Note: Before using CFG in the mingw32-make build you need to build with using it; else the build errors out.

Nice explanation. But...

What do you mean by the above quote? Did you mean " Before using CFG in the project, you need to ..." ??

I have never got the following command to work
mingw32-make -f makefile.gcc VENDOR=rc3 CFG=rc3 USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug   UNICODE=1

unless I have ran this command on the same wxWidgets folders
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug   UNICODE=1

I am guessing that the build without the CFG creates a file or directory needed by the build with the CFG.

Tim S
« Last Edit: December 07, 2006, 03:03:16 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2180
Re: How to use both Debug and Release builds of wx libraries?
« Reply #5 on: December 07, 2006, 03:37:15 pm »
I have never got the following command to work
mingw32-make -f makefile.gcc VENDOR=rc3 CFG=rc3 USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug   UNICODE=1

unless I have ran this command on the same wxWidgets folders
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug   UNICODE=1

I am guessing that the build without the CFG creates a file or directory needed by the build with the CFG.

Tim S


Thank you, added to: FAQ