<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[Resolved]Qt 4.8.2 + vs2010 + static  + project build issues LNK2019 (QString) &amp; LNK2005]]></title><description><![CDATA[<p dir="auto">I had successfully compiled a static version of qt4.8.2 by following the instructions from this "post ":<a href="http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/</a></p>
<p dir="auto">configure command I used to compile Qt:<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/c">@<bdi>C</bdi></a>:\Qt\vs2010-4.8.2-static&gt;configure -static -debug-and-release -opensource -no-q<br />
t3support -qt-sql-sqlite -phonon -phonon-backend -platform win32-msvc2010@</p>
<p dir="auto">However, I encountered a list of compile errors from my project, LNK2019 &amp; LNK2005 related.</p>
<p dir="auto">I attached the error messages at the bottom.</p>
<p dir="auto">For the LNK2005 related errors , I included LIBCMT at Linker-&gt;Input-&gt;Ignore Specific Default Libraries, and its related errors disappear from the error list, but is that the right way to do it?<br />
For the LNK2019 related errors, I couldn't resolve them, please give me some instructions.</p>
<p dir="auto">Here is my project settings:<br />
@<br />
C/C++ -&gt; Code Generation -&gt; Runtime Library: Multi-threaded Debug (/MTd)<br />
C/C++ -&gt; Language -&gt; Treat WChar_t As Built in Type: No ( /Zc:wchar_t- )<br />
Linker-&gt; Input -&gt; Additional Dependencies:<br />
Imm32.lib<br />
Ws2_32.lib<br />
winmm.lib<br />
qtmaind.lib<br />
QtCored.lib<br />
QtGuid.lib<br />
wsock32.lib<br />
@<br />
LNK2019 related error messages:<br />
@<br />
Error 161 error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; __thiscall QString::toStdString(void)const " (_<em>imp</em>?toStdString@QString@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "private: void __thiscall MainForm::on_actionConfiguration_triggered(void)" (?on_actionConfiguration_triggered@MainForm@@AAEXXZ) C:\Working\ProjLocation\test\mainform.obj test<br />
Error 163 error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString &amp; __thiscall QString::append(char const *)" (_<em>imp</em>?append@QString@@QAEAAV1@PBD@Z) referenced in function "private: void __thiscall MainForm::summaries_series(struct series const *)" (?summaries_series@MainForm@@AAEXPBUseries@@@Z) C:\Working\ProjLocation\test\mainform.obj test<br />
Error 162 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::QString(char const *)" (_<em>imp</em>??0QString@@QAE@PBD@Z) referenced in function "private: void __thiscall MainForm::on_actionLogin_triggered(void)" (?on_actionLogin_triggered@MainForm@@AAEXXZ) C:\Working\ProjLocation\test\mainform.obj test<br />
@<br />
LNK2005 related error messages:<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/error">@<bdi>Error</bdi></a> 12 error LNK2005: __set_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj) C:\Working\ProjLocation\test\LIBCMT.lib(invarg.obj) test</p>
<p dir="auto">&lt;more LIBCMT &amp; LIBCMTD related errors.....&gt;</p>
<p dir="auto">Error 17 error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj) C:\Working\ProjLocation\test\LIBCMT.lib(invarg.obj) test<br />
@</p>
<p dir="auto">[edit] Code wrappers added for clarity. Please do next time, koahnig</p>
]]></description><link>https://forum.qt.io/topic/17323/resolved-qt-4-8-2-vs2010-static-project-build-issues-lnk2019-qstring-lnk2005</link><generator>RSS for Node</generator><lastBuildDate>Wed, 23 Sep 2026 05:37:54 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/17323.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 05 Jun 2012 09:35:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Resolved]Qt 4.8.2 + vs2010 + static  + project build issues LNK2019 (QString) &amp; LNK2005 on Thu, 07 Jun 2012 01:58:27 GMT]]></title><description><![CDATA[<p dir="auto">The default Qt project's properties created by the vs add-in was different than before, after I re-compiled the Qt source. Therefore, I copied the new properties setting from the new project to my old project, and problem solved.</p>
]]></description><link>https://forum.qt.io/post/141095</link><guid isPermaLink="true">https://forum.qt.io/post/141095</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 07 Jun 2012 01:58:27 GMT</pubDate></item><item><title><![CDATA[Reply to [Resolved]Qt 4.8.2 + vs2010 + static  + project build issues LNK2019 (QString) &amp; LNK2005 on Thu, 07 Jun 2012 01:26:31 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="lfdm" date="1339016060"]It looks like one of the library at least linked in the project is using libcmt. Did you check that you are only linking debug builds in your project?[/quote]</p>
<p dir="auto">Thank you for your reply Ifdm. You are right about the LNK2005 issue. How about the LNK2019 errors? I could not resolve them.</p>
]]></description><link>https://forum.qt.io/post/141094</link><guid isPermaLink="true">https://forum.qt.io/post/141094</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 07 Jun 2012 01:26:31 GMT</pubDate></item><item><title><![CDATA[Reply to [Resolved]Qt 4.8.2 + vs2010 + static  + project build issues LNK2019 (QString) &amp; LNK2005 on Wed, 06 Jun 2012 20:54:20 GMT]]></title><description><![CDATA[<p dir="auto">It looks like one of the library at least linked in the project is using libcmt. Did you check that you are only linking debug builds in your project?</p>
]]></description><link>https://forum.qt.io/post/141083</link><guid isPermaLink="true">https://forum.qt.io/post/141083</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 06 Jun 2012 20:54:20 GMT</pubDate></item></channel></rss>