PDA

View Full Version : Unresolved externals in VSTi release build


DukeRoodee
06-04-2010, 02:10 AM
Hi All :-)

I have a nice little problem building a vsti project of mine. It´s not a specific IPlug /WDL problem, but maybe somebody here had similar problems and can give me a clue ?

Every time i try to build a Release version as Multithreaded (/MT)(C++ Visual Studio 2008) i get a list of unresolved externals. I´ve buildt all libs (lice and IPlug) with the /MT flag and max optimizations.
If i just switch the /MT to /MTd (Multithreaded Debug) and let the rest of the settings as they are, it works fine.
Using /NODEFAULTLIB LIBCMTD the unresolved list is like this:


("Nicht aufgelöstes externes Symbol" means "unresolved external symbol")

1>LINK : warning LNK4098: Standardbibliothek "LIBCMT" steht in Konflikt mit anderen Bibliotheken; /NODEFAULTLIB:Bibliothek verwenden.
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "__CrtDbgReportW".
1>Common.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__CrtDbgReportW" in Funktion ""public: char const & __thiscall std::_String_const_iterator<char,struct std::char_traits<char>,class std::allocator<char> >::operator*(void)const " (??D?$_String_const_iterator@DU?$char_traits@D@std @@V?$allocator@D@2@@std@@QBEABDXZ)".
1>IPlugExample.obj : error LNK2001: Nicht aufgelöstes externes Symbol "__CrtDbgReportW".
1>Logger.obj : error LNK2001: Nicht aufgelöstes externes Symbol "__CrtDbgReportW".
1>libcpmtd.lib(stdthrow.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "__CrtDbgReportW".
1>libcpmtd.lib(xdebug.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__malloc_dbg" in Funktion ""void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)".
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "__malloc_dbg".
1>libcpmtd.lib(xdebug.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__free_dbg" in Funktion ""void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)".
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "__free_dbg".
1>libcpmtd.lib(_tolower.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__calloc_dbg" in Funktion "__Getctype".
1>Release/SpectraBrass.dll : fatal error LNK1120: 4 nicht aufgelöste externe Verweise.
1>Das Buildprotokoll wurde unter "file://e:\AudioDevel\CPP\SpectraBrass\Release\BuildLog.ht m" gespeichert.
1>IPlugExample - 11 Fehler, 1 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========

I´ve googled around a lot but could not find any helpful posts. Somebody an idea ? (If you need to see anything more like configuration settings, just tell me...)

Thanks & best regards
Rudi

cc_
06-05-2010, 03:02 AM
It looks the code is being compiled to use debug functions (like __malloc_dbg) probably recompiling libcpmtd.lib with /NDEBUG defined will fix it.

Edit: actually libcmptd.lib looks like a standard library, maybe that is the debug version and you should be linking with libcmpt.lib?

bvesco
06-05-2010, 11:24 AM
Solution detailed here (found via google of [iplug libcmt]):

http://www.plugindeveloper.com/02/lice-libcmt-errors

Also, I'm not mentioning google to be a smart ass, I only bring it up to encourage you to do some searching as you can often find the answer much quicker than waiting for a forum response. Then you're up and running right away. However, posting extra threads about it also helps the next person who googles the problem because then they get more hits ;)

DukeRoodee
06-05-2010, 03:39 PM
Hi Guys,

first, let me thank you for your help. Finally, I could make it build...but...

>>Solution detailed here (found via google of [iplug libcmt]):
http://www.plugindeveloper.com/02/lice-libcmt-errors<<

Yes, this page tells me what i already read on some other pages...that i may build all needed projects (in my case lice, iplug and the vsti) with /MT, which i actually did. However this page told me that other people ran into exactly the same problem (including lice and iplug) and that there must be an easy solution...

>>Edit: actually libcmptd.lib looks like a standard library, maybe that is the debug version and you should be linking with libcmpt.lib?<<
I did that ... made it even worse. Then I had another look at the "unresolveds" and wondered why on earth "__CrtDbgReportW" is referenced from modules which were compiled without debug info and with /MT.

Finally, the solution is as funny as awkward (for me).... there was a "_DEBUG" as preprocessor statement which i didnt see. Deleted it and ... it works. 2 days for this <ROFL>


>>Also, I'm not mentioning google to be a smart ass, I only bring it up to encourage you to do some searching as you can often find the answer much quicker than waiting for a forum response.<<
Oh, dont think i didnt google for this problem, i usually do this before posting in forums. I actually found a lot of pages dealing with this prob, some of them saying "use /MT", but as you see the problem was a tiny little bit different ;-)

thanks !
regards
Rudi