News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

How to use both Debug and Release builds of wx libraries?

Started by zorro, December 07, 2006, 09:03:09 AM

Previous topic - Next topic

zorro

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.

dje

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

stahta01

Quote from: zorro 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.

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


C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Pecan

Quote from: stahta01 on December 07, 2006, 10:15:28 AM
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 ..." ??

stahta01

Quote from: Pecan on December 07, 2006, 02:23:12 PM
Quote from: stahta01 on December 07, 2006, 10:15:28 AM
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
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Pecan

Quote from: stahta01 on December 07, 2006, 03:00:59 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