News:

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

Main Menu

Link trouble when migrating from Microsoft VC

Started by nlevisrael, March 01, 2012, 01:32:22 AM

Previous topic - Next topic

nlevisrael

Hi: I tried to create a new wxWidgets project using the wizard, but it's not linking properly.  So I created a new project in Visual C++ express 2010 which built and ran the project fine.  I therefore tried to replicate the VS project settings in codeblocks, but I'm still getting link errors.  It looks like I'm missing a library which VS includes automatically.  I read that Code::Blocks can open vcproj files but when I try to do so I get a dialog that Code::Blocks can't open the file type.  For the record, I pasted some of my link output.  Thanks for any help.

wxmsw29ud_core.lib(frame.obj)||warning LNK4229: invalid directive '/FAILIFMISMATCH:_MSC_VER=1600' encountered; ignored|

... bunch like that
wxbase29ud.lib(longlong.obj)||warning LNK4049: locally defined symbol ?_Debug_message@std@@YAXPB_W0I@Z (void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)) imported|
...
std::_Xlength_error(char const *)" (__imp_?_Xlength_error@std@@YAXPBD@Z)|
wxbase29ud.lib(mimetype.obj)||error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl
std::_Xlength_error(char const *)" (__imp_?_Xlength_error@std@@YAXPBD@Z)|
wxbase29ud.lib(textfile.obj)||error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Xlength_error(char const *)" (__imp_?_Xlength_error@std@@YAXPBD@Z)|
wxbase29ud.lib(ipcbase.obj)||error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl
...
wxbase29ud.lib(module.obj)||error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Xlength_error(char const *)" (__imp_?_Xlength_error@std@@YAXPBD@Z)|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 883 warnings ===|

MortenMacFly

Quote from: nlevisrael on March 01, 2012, 01:32:22 AM
wxmsw29ud_core.lib(frame.obj)||warning LNK4229: invalid directive '/FAILIFMISMATCH:_MSC_VER=1600' encountered; ignored|
You cannot and should not mix libraries of different compilers. The wizard creates one for GCC (MinGW). So please use the GCC/MinGW version of wxWidgets in the right flavour.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

nlevisrael

Thank you, but when I ran the wizard I chose the VS compiler instead.  The only wxWidgets build I have right now used that compiler.

MortenMacFly

Quote from: nlevisrael on March 01, 2012, 01:32:22 AM
wxmsw29ud_core.lib(frame.obj)||warning LNK4229: invalid directive '/FAILIFMISMATCH:_MSC_VER=1600' encountered; ignored|
How did you setup the wizard? did you choose the right/same wxWidgets flavour you've used to compile the app with? From what I see, its Unicode / debug / non-monolithic. Its really hard to tell because I don't know what you did you get your wxWidgets version... The MS linker (not C::B) basically tells you the wx lib is incompatible to the settings you've used for your app. Where the incompatibility comes from you have to find out yourself I'm afraid.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]