User forums > Help

Link trouble when migrating from Microsoft VC

(1/1)

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|

--- End quote ---
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.

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|

--- End quote ---
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.

Navigation

[0] Message Index

Go to full version