wx 3.0.2 compile puzzle

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
shirley_hu
In need of some credit
In need of some credit
Posts: 8
Joined: Tue Jul 26, 2016 5:03 am

wx 3.0.2 compile puzzle

Post by shirley_hu »

In my case , while compiling my C++ solution as Relase version, called the Library wx3.0 whose version is Release ,and in property page,C/C++--->Code Generation--->Runtime Library,which set to "Multi-threaded DLL(M/D)", in the processing of compiling , there's no error message, and an .exe file is created successfully.
Howerver,when put this .exe file to a PC without develop environment, an error will appeaerd, and the message is as shown below:

The program can't start because MSVCR120D.dll is missing from your computer. Try installing the program to fix this problem.

And in this case, if I change the WX3.0.2 to Wx2.8(whose version is also Release), and put the .exe to the same PC without develop environment, it can be started successfully. And i'm very sure that the version of WX3.0 is Release.

My puzzle is while called wx3.0 library,why the program will call the Debug dll while my program version is Release??? If anyone can help me to resolve the problem? Thanks
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wx 3.0.2 compile puzzle

Post by doublemax »

Check the library paths and library names you're linking into your project, maybe you're accidentally linking some debug versions somewhere.

Also try a clean rebuild of the wx libs and your project.
Use the source, Luke!
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: wx 3.0.2 compile puzzle

Post by catalin »

shirley_hu wrote:in property page,C/C++--->Code Generation--->Runtime Library,which set to "Multi-threaded DLL(M/D)"
Check that this is for Configuration: Release and the same Platform:.
Make sure that Linker--->General--->Output File is really the one you are copying to the other machine.
shirley_hu
In need of some credit
In need of some credit
Posts: 8
Joined: Tue Jul 26, 2016 5:03 am

Re: wx 3.0.2 compile puzzle

Post by shirley_hu »

doublemax wrote:Check the library paths and library names you're linking into your project, maybe you're accidentally linking some debug versions somewhere.

Also try a clean rebuild of the wx libs and your project.
Thansk for your help and there's another puzzle troubled me. Why link Release VERSION wx3.0 to generate a program, and in the using of the program, errors like "An assertion failed" will appeared?
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wx 3.0.2 compile puzzle

Post by doublemax »

Thansk for your help and there's another puzzle troubled me.
Does that mean that the original problem is solved?
Why link Release VERSION wx3.0 to generate a program, and in the using of the program, errors like "An assertion failed" will appeared?
Since wx 3.0 some asserts are even enabled in the release version. In order to change that (for Visual Studio) you have to edit the master copy of "setup.h" and rebuild the libraries.

Edit <wx>/include/wx/msw/setup.h
Change this:

Code: Select all

// #ifdef NDEBUG
//  #define wxDEBUG_LEVEL 0
// #else
//  #define wxDEBUG_LEVEL 2
// #endif
to:

Code: Select all

#ifdef NDEBUG
 #define wxDEBUG_LEVEL 0
// #else
//  #define wxDEBUG_LEVEL 2
#endif
Use the source, Luke!
shirley_hu
In need of some credit
In need of some credit
Posts: 8
Joined: Tue Jul 26, 2016 5:03 am

Re: wx 3.0.2 compile puzzle

Post by shirley_hu »

doublemax wrote:
Thansk for your help and there's another puzzle troubled me.
Does that mean that the original problem is solved?

No, the original problem still exits, and i've tried to rebuild the wx3.0 and the result is same.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wx 3.0.2 compile puzzle

Post by doublemax »

No, the original problem still exits, and i've tried to rebuild the wx3.0 and the result is same.
There must be one component that's still in debug mode.

In the project properties:
Check the paths under: Linker -> General -> Additional Library Directories
Check the library names under: Linker -> Input -> Additional Dependencies

I'm almost sure there's a library in debug mode used somewhere. The debug libraries have a "d" in their name:
wxmsw30ud_adv.lib - "ud" => Unicode Debug
wxmsw30u_adv.lib - "u" => Unicode (Release)

If everything fails just use static linking. I'd prefer that anyway.
Use the source, Luke!
shirley_hu
In need of some credit
In need of some credit
Posts: 8
Joined: Tue Jul 26, 2016 5:03 am

Re: wx 3.0.2 compile puzzle

Post by shirley_hu »

doublemax wrote:
No, the original problem still exits, and i've tried to rebuild the wx3.0 and the result is same.
There must be one component that's still in debug mode.

In the project properties:
Check the paths under: Linker -> General -> Additional Library Directories
Check the library names under: Linker -> Input -> Additional Dependencies

I'm almost sure there's a library in debug mode used somewhere. The debug libraries have a "d" in their name:
wxmsw30ud_adv.lib - "ud" => Unicode Debug
wxmsw30u_adv.lib - "u" => Unicode (Release)

If everything fails just use static linking. I'd prefer that anyway.
I've checked the libaries which are input in Linker->Input,and have no idear which may cause the issue. The libraries are shown below,could you pls help to check them. thks.

comctl32.lib;rpcrt4.lib;wsock32.lib;wxmsw30u_adv.lib;wxmsw30u_core.lib;wxbase30u.lib;wxbase30u_xml.lib;wxmsw30u_aui.lib;wxmsw30u_html.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;oleacc.lib;odbc32.lib;odbccp32.lib;tcl84.lib;libnoact.lib;lmgr_dongle_stub.lib;libcrvs.lib;libsb.lib;lmgr_trl.lib;libFNPload.lib;Wbemuuid.lib;Ws2_32.lib;netapi32.lib;zip.lib;
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wx 3.0.2 compile puzzle

Post by doublemax »

Debug versions usually have a "d" at their end or in another significant place. E.g. "wxmsw30u_core.lib" -> "wxmsw30ud_core.lib" or "zip.lib" -> "zipd.lib".

But i don't see any in that list, so i'm a little out of ideas at the moment.
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wx 3.0.2 compile puzzle

Post by ONEEYEMAN »

Hi,
Could you try to place all wx libraries first and then all standard Windows one?

Something like this:

Code: Select all

wxmsw30u_adv.lib;wxmsw30u_core.lib;wxbase30u.lib;wxbase30u_xml.lib;wxmsw30u_aui.lib;wxmsw30u_html.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;winmm.lib;oleacc.lib;odbc32.lib;odbccp32.lib;tcl84.lib;libnoact.lib;lmgr_dongle_stub.lib;libcrvs.lib;libsb.lib;lmgr_trl.lib;libFNPload.lib;Wbemuuid.lib;Ws2_32.lib;netapi32.lib;zip.lib;
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wx 3.0.2 compile puzzle

Post by doublemax »

Could you try to place all wx libraries first and then all standard Windows one?
Library order doesn't matter in Visual Studio. And if, it wouldn't explain this specific error.

Try putting the linker in verbose mode. (Project properties -> Linker -> General -> Show Progress -> /Verbose

This will produce a big log, but maybe you'll detect something suspicious in it.
Use the source, Luke!
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: wx 3.0.2 compile puzzle

Post by stahta01 »

I think using dependencywalker (depends.exe) might help locate the cause to a single wx DLL.
http://www.dependencywalker.com/

Tim S.
Post Reply