Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you build a debug .exe (MSVCRTD.lib) against a release built lib (MSVCRT.lib)?
    text
    copied!<p>I'm using Visual C++ 2008, SP1. I have a QT app (gui, .exe) in debug build config. It's set to use the Multi-threaded Debug DLL version of the CRT, aka MSVCRTD.lib.</p> <p>I'm linking against a 3rd party library that is built in release mode and using the Multi-threaded DLL (non-debug) version of the CRT, aka MSVCRT.lib.</p> <p>It links and runs but crashes at startup. While linking I get the warning:</p> <p>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library</p> <p>I tried setting /NODEFAULTLIB:msvcrt.lib</p> <p>but that resulted in 5 linking errors due to missing symbols.</p> <p>So is it not possible to use two different libs? What is the alternative? Can I create a DLL out of the 3rd party lib I have? Or is that something the 3rd party would have to do?</p> <p>The exception at startup is:</p> <p>"Unhandled exception at ....... in MyApp.exe: ...... Access violation reading location 0x00000000f"</p> <p>The following is the call stack after the app is run and it crashes:</p> <pre><code>MyApp.exe!std::_Aux_cont::_Getcont() + 0xa bytes C++ MyApp.exe!std::_Iterator_base_aux::_Getmycont() + 0x1b bytes C++ MyApp.exe!std::_Tree&lt;std::_Tmap_traits&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,unsigned int,std::less&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const ,unsigned int&gt; &gt;,0&gt; &gt;::const_iterator::operator*() + 0x28 bytes C++ MyApp.exe!std::_Tree&lt;std::_Tmap_traits&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,unsigned int,std::less&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const ,unsigned int&gt; &gt;,0&gt; &gt;::iterator::operator*() + 0xf bytes C++ MyApp.exe!std::map&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,unsigned int,std::less&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt;,std::allocator&lt;std::pair&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const ,unsigned int&gt; &gt; &gt;::operator[]() + 0xe9 bytes C++ MyApp.exe!ThirdPartyLib::client::`anonymous namespace'::init_xlt_mode() + 0x5f bytes C++ MyApp.exe!_GetCommandLineW@0() + 0x8d8f3 bytes C++ msvcr90d.dll!_initterm(void (void)* * pfbegin=0x006c4468, void (void)* * pfend=0x006cb0b8) Line 903 C MyApp.exe!__tmainCRTStartup() Line 501 + 0xf bytes C MyApp.exe!WinMainCRTStartup() Line 403 C kernel32.dll!7c817067() </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload