Building both debug & release version of WxWidgets on Li

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
cshong
Earned a small fee
Earned a small fee
Posts: 19
Joined: Sat Aug 25, 2007 3:04 am

Building both debug & release version of WxWidgets on Li

Post by cshong »

In Windows, the debug version of each built wxWidgets library has the character 'd', while the release version don't have.

However, in Linux, even if I type the command "./configure --enable-debug", the built library does not have the character 'd'.

How can I know whether the wxWidgets library I built in Linux is the debug version?

If I want to use both release and debug version of library on the same project in Linux, how can I build both debug and release version of wxWidgets library?
briceandre
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 672
Joined: Tue Aug 31, 2010 6:22 am
Location: Belgium

Post by briceandre »

To build the libs, you should do something like this :
- cd <wxWidgets_dir>/build
- mkdir linux_debug
- cd linux_debug
- ../../configure <your_wx_options> --enable-debug && make && sudo make install
- cd ..
- mkdir linux_release
- cd linux_release
- ../../configure <your_wx_options> && make && sudo make install

Once everything is compiled, you must compile and link your app by using the wx-config script :
g++ `wx-config --cxxflags` ...
or
g++ `wx-config --cxxflags --debug` ...

and for link
g++ `wx-config --libs`
or
g++ `wx-config --libs --debug`
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart »

Hi,
However, in Linux, even if I type the command "./configure --enable-debug", the built library does not have the character 'd'.
They do in wx2.8 (actually, they should say 'ud' as you should have configured --enable-unicode ;) ). However in wx2.9 that's no longer happens, as there's much less difference between a debug and a release library.

As briceandre suggests, you should build in a subdirectory of the wxGTK source; but better still would be to configure with --prefix=$(pwd) and not install. That way different builds are stored in separate directories, and there is no chance of conflict. See e.g. http://forums.wxwidgets.org/viewtopic.php?t=29659

Regards,

David
cshong
Earned a small fee
Earned a small fee
Posts: 19
Joined: Sat Aug 25, 2007 3:04 am

Post by cshong »

briceandre wrote:To build the libs, you should do something like this :
- cd <wxWidgets_dir>/build
- mkdir linux_debug
- cd linux_debug
- ../../configure <your_wx_options> --enable-debug && make && sudo make install
- cd ..
- mkdir linux_release
- cd linux_release
- ../../configure <your_wx_options> && make && sudo make install

Once everything is compiled, you must compile and link your app by using the wx-config script :
g++ `wx-config --cxxflags` ...
or
g++ `wx-config --cxxflags --debug` ...

and for link
g++ `wx-config --libs`
or
g++ `wx-config --libs --debug`
The problem is that if I use your ways, the "make install" command will replace the existing library in /usr/local/lib. That mean if I compile and install the release version after the debug version, the debug version installed in /usr/local/lib will be replaced with release version.

So, how to solve this?
briceandre
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 672
Joined: Tue Aug 31, 2010 6:22 am
Location: Belgium

Post by briceandre »

Either, as suggested by DavidHart, you do not install, or you prefix your installation (never tested, but it should work)
User avatar
Chikwado
Knows some wx things
Knows some wx things
Posts: 38
Joined: Mon Sep 25, 2017 5:40 pm
Location: Nigeria
Contact:

Re: Building both debug & release version of WxWidgets on Li

Post by Chikwado »

This Thread Seem To Be A Very Old Thread, But Very Useful To Me. For Example: The Explanation Above Seem To Be For Linux, Are There Example For Window?
Window 8.1 x86, Codeblock 20.03, TDC-GCC-10.3.0, C++ 20, wxWidgets-3.2.1
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Building both debug & release version of WxWidgets on Li

Post by ONEEYEMAN »

Hi,
What is you compiler? Do you use any IDE? How do you build the library?

Thank you.
Post Reply