<?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[Qt Creator, linked boost library and debug]]></title><description><![CDATA[<p dir="auto">Hello.</p>
<p dir="auto">I have found a strange problem with Qt Creator and boost library.<br />
I have a simple "Hello World!" program in the Qt Creator. So far so good. But I need to use the boost::filesystem library.<br />
So I add:</p>
<p dir="auto">@<br />
#include &lt;boost/filesystem.hpp&gt;<br />
@</p>
<p dir="auto">to the source code and</p>
<p dir="auto">@<br />
INCLUDEPATH += C:/boost<br />
LIBS += C:/boost/stage/lib/libboost_filesystem-mgw45-mt-d-1_46_1.a<br />
LIBS += C:/boost/stage/lib/libboost_system-mgw45-mt-d-1_46_1.a<br />
@</p>
<p dir="auto">to the .pro file</p>
<p dir="auto">Building the application for the "release" target is OK, no errors. Result executable executes and works well.<br />
But for the "debug" target it doesn't. I got the error:<br />
The process could not be started: %1 is not a valid Win32 application.<br />
Debugging can be started but it ignores all breakpoints and terminates immediately.</p>
<p dir="auto">Don't you know what could case this problem?<br />
If I don't have #include &lt;boost/filesystem.hpp&gt; in the source code, the "debug" executable can be executed, but when I include boost/filesystem, it immediately becomes invalid win32 application. However "release" executable works well in both cases.</p>
<p dir="auto">Thank you.</p>
<p dir="auto">P.S.<br />
I tried to create the same simple application in Code::Blocks, just to test whether included boost libraries are compiled correctly and yes, there's no problem with both release and debug build targets, all works fine. So it doesn't seem to be a problem with boost libraries.</p>
<p dir="auto">I'm using Qt SDK 1.1, Qt Creator 2.2 installed later, Windows 7 Ultimate x64</p>
<p dir="auto"><em>[EDIT: code formatting, please wrap in @-tags, Volker]</em></p>
]]></description><link>https://forum.qt.io/topic/5866/qt-creator-linked-boost-library-and-debug</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 05:26:25 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/5866.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 May 2011 11:02:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qt Creator, linked boost library and debug on Mon, 08 Jul 2013 15:26:04 GMT]]></title><description><![CDATA[<p dir="auto">If you happen to change boost versions, this is perhaps more generic way of doing this:<br />
(define your environment variable pointing at boost-root, e.g. C:\boost_1_54_0)</p>
<p dir="auto">than, for gcc4.7.2 (e.g. from qt 5.0.2)<br />
in .pro file:</p>
<p dir="auto">@    INCLUDEPATH +=  $(BOOST_ROOT)<br />
BOOST = $(BOOST_ROOT)<br />
GCC_VER = system(gcc -dumpversion)<br />
COMPILER = gcc-mingw-$${GCC_VER}<br />
#dunno how to make mgw47 from gcc-mingw and 4.7.2 from here..<br />
COMPILER_SHORT = mgw47</p>
<pre><code>BOOST_SUFFIX = $${COMPILER_SHORT}-mt-${BOOST_VER}

LIBS += -L$${BOOST}/stage/lib

// now you can add your libraries, e.g.
LIBS += -lboost_system-$${BOOST_SUFFIX}

LIBS += -lboost_WHATEVER-$${BOOST_SUFFIX} // just change 'WHATEVER' to a valid lib name..@
</code></pre>
<p dir="auto">(obviously above is assuming you've compiled your boost with the same compiler, e.g.:</p>
<p dir="auto">@cd %BOOST_ROOT%;<br />
set PATH=C:\Qt\Qt5.0.2\Tools\MinGW\bin;%PATH%;<br />
boostrap gcc<br />
b2 --build-dir=/temp/build-boost toolset=gcc stage@</p>
<p dir="auto">if you're using boost_1_54, you'd better off defining following in your project-config.jam before the build:<br />
@using gcc : : :<br />
&lt;cxxflags&gt;-std=c++0x<br />
&lt;cxxflags&gt;"-include cmath"<br />
;@</p>
<p dir="auto">etc..</p>
]]></description><link>https://forum.qt.io/post/101488</link><guid isPermaLink="true">https://forum.qt.io/post/101488</guid><dc:creator><![CDATA[formiaczek]]></dc:creator><pubDate>Mon, 08 Jul 2013 15:26:04 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Creator, linked boost library and debug on Wed, 18 May 2011 09:58:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tobias">@<bdi>Tobias</bdi></a> Hunger:<br />
Oh yes, that's it. It works now.<br />
Qt Creator 2.1 probably choose the right MinGW by itself (I cannot check it, Tool Chain combobox is disabled in build settings there and no "Tool Chain" option in Tools/Options is present) but 2.2 set up its toolchain to QtSDK's MinGW 4.4.0.<br />
When I changed ToolChain to "MinGW (x86 32bit) - 4.5.0" in QTC 2.2, both release and debug builds started to work fine.</p>
<p dir="auto">Thank you very much, Tobias.</p>
]]></description><link>https://forum.qt.io/post/88569</link><guid isPermaLink="true">https://forum.qt.io/post/88569</guid><dc:creator><![CDATA[o.vencovsky]]></dc:creator><pubDate>Wed, 18 May 2011 09:58:27 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Creator, linked boost library and debug on Wed, 18 May 2011 09:33:25 GMT]]></title><description><![CDATA[<p dir="auto">Just few comments<br />
Qt Creator  2.2 work fine on windows xp/seven with Qt SDK 1.1</p>
<h1>install Visual C++ 2008 Express Edition (free, uncheck SQL serveur express if you don't have to use)</h1>
<h1>install QtSDK 1.1 VS2008 (uncheck all about MinGW, check delete QtCreator previous settings)</h1>
<h1>install QtCreator 2.2 (uncheck MinGW)</h1>
<p dir="auto">Both Qt Creator 2.1/2.2 work fine (release and debug)</p>
]]></description><link>https://forum.qt.io/post/88553</link><guid isPermaLink="true">https://forum.qt.io/post/88553</guid><dc:creator><![CDATA[gedd]]></dc:creator><pubDate>Wed, 18 May 2011 09:33:25 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Creator, linked boost library and debug on Wed, 18 May 2011 09:19:23 GMT]]></title><description><![CDATA[<p dir="auto">Could you please try setting up mingw 4.5 in Qt Creator? Go to Tools-&gt;Options-&gt;Tool chain and add a new mingw tool chain. Point it to the g++ of the mingw 4.5, rename the whole thing (click on the name in the table) and apply the whole thing.</p>
<p dir="auto">You should not be able to select that version to build your project. Does it work when building with the newer mingw?</p>
]]></description><link>https://forum.qt.io/post/88547</link><guid isPermaLink="true">https://forum.qt.io/post/88547</guid><dc:creator><![CDATA[tobias.hunger]]></dc:creator><pubDate>Wed, 18 May 2011 09:19:23 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Creator, linked boost library and debug on Wed, 18 May 2011 09:09:14 GMT]]></title><description><![CDATA[<p dir="auto">Hi.<br />
Well, it seems there's really problem with MinGW versions I have installed, you're right.</p>
<h1>My default MinGW installation (C:\MinGW) is version 4.5.0</h1>
<h1>Code::Blocks uses this default installation, so it's running on 4.5.0</h1>
<h1>Compilation of boost libraries (bootstrap, bjam) used this default MinGW too, it's compiled with 4.5.0</h1>
<h1>But QtSDK comes with its own MinGW - 4.4.0</h1>
<h1>And Qt Creator 2.2 also comes with its own MinGW - also 4.4.0</h1>
<h1>In "Build Settings" of both Qt Creators (2.1 from QtSDK and standalone 2.2) I can see the same settings in Qt version - "Qt 4.7.3 for Desktop - MinGW 4.4 (Qt SDK)," referencing "c:\qtsdk\desktop\qt\4.7.3\mingw\bin\qmake.exe" directory.</h1>
<p dir="auto">So I have boost libraries compiled with MinGW 4.5.0, but Qt Creator uses its own 4.4.0 for my program. It can be the problem, I see.<br />
But why release works fine and only debug fails in Qt Creator 2.2?<br />
And why Qt Creator 2.1 releases and debugs with no problem - especially if both 2.1 and 2.2 use the same Qt from QtSDK?</p>
<p dir="auto">For Code::Blocks I created a new project from scratch - in fact it creates a "Hello World" main.cpp automatically when new project is created, so all I had to do was to add libraries to linker, includes to compiler and one line of code: #include &lt;boost/filesystem.hpp&gt;</p>
<p dir="auto">Thank you.</p>
]]></description><link>https://forum.qt.io/post/88543</link><guid isPermaLink="true">https://forum.qt.io/post/88543</guid><dc:creator><![CDATA[o.vencovsky]]></dc:creator><pubDate>Wed, 18 May 2011 09:09:14 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Creator, linked boost library and debug on Tue, 17 May 2011 14:58:26 GMT]]></title><description><![CDATA[<p dir="auto">Well, great that this helps for now, but the SDK will eventually upgrade to Qt Creator 2.2 and then you will have the same issue. I would really appreciate getting this nailed down:-)</p>
<p dir="auto">Can you make your example available to us? How did you build it in codeblocks? Did you use a different build system or did you reuse the qmake .pro-file you had? Did codeblocks and creator use the same mingw?</p>
]]></description><link>https://forum.qt.io/post/88405</link><guid isPermaLink="true">https://forum.qt.io/post/88405</guid><dc:creator><![CDATA[tobias.hunger]]></dc:creator><pubDate>Tue, 17 May 2011 14:58:26 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Creator, linked boost library and debug on Tue, 17 May 2011 14:44:22 GMT]]></title><description><![CDATA[<p dir="auto">Hi.</p>
<p dir="auto">Thank you for your reply.<br />
You know what? You have solved my problem with one sentence:<br />
<em>Don’t use QTCreator 2.2 wich is not delivered with Qt SDK 1.1</em><br />
That is, it works with Qt Creator 2.1 supplied with Qt SDK, but not with QTC 2.2. (Maybe different version of MinGW coming with this new version...?)</p>
<p dir="auto">I didn't even had to change LIBS += settings in the .pro file.<br />
And about .dll - they are used for dynamic linking, but I want statick link, I want to produce single .exe file.</p>
<p dir="auto">Thank you very much for your help.</p>
]]></description><link>https://forum.qt.io/post/88402</link><guid isPermaLink="true">https://forum.qt.io/post/88402</guid><dc:creator><![CDATA[o.vencovsky]]></dc:creator><pubDate>Tue, 17 May 2011 14:44:22 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Creator, linked boost library and debug on Tue, 17 May 2011 12:34:51 GMT]]></title><description><![CDATA[<p dir="auto">On windows you're using .dll, not .a.</p>
<p dir="auto">So what's you compiler ? (mingw 4.5 ?)</p>
<p dir="auto">Don't use QTCreator 2.2 wich is not delivered with Qt SDK 1.1</p>
<p dir="auto">try :</p>
<h1>-L : this is a path</h1>
<h1>-l : is a file without extension (.a or .lib is added)</h1>
<h1>\ : continue on following line</h1>
<h1>$$quote(..) : useful for path like 'c:/program files'</h1>
<p dir="auto">@DEFINES += BOOST_ALL_DYN_LINK  # for using dynamic libraries</p>
<p dir="auto">LIBS += -L$$quote(C:/boost/stage/lib)  \<br />
-llibboost_filesystem-mgw45-mt-d-1_46_1 <br />
-llibboost_system-mgw45-mt-d-1_46_1@</p>
<p dir="auto">eventually make separate config for debug and release<br />
@<br />
CONFIG(debug, debug|release) {<br />
LIBS += -L$$quote(C:/boost/stage/lib)  \<br />
-llibboost_filesystem-mgw45-mt-d-1_46_1 <br />
-llibboost_system-mgw45-mt-d-1_46_1<br />
} else {<br />
LIBS += -L$$quote(C:/boost/stage/lib)  \<br />
-llibboost_filesystem-mgw45-mt-1_46_1 <br />
-llibboost_system-mgw45-mt-1_46_1<br />
}<br />
@</p>
]]></description><link>https://forum.qt.io/post/88367</link><guid isPermaLink="true">https://forum.qt.io/post/88367</guid><dc:creator><![CDATA[gedd]]></dc:creator><pubDate>Tue, 17 May 2011 12:34:51 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Creator, linked boost library and debug on Mon, 16 May 2011 13:00:16 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the answer.</p>
<p dir="auto">Unfortunately this is not the problem. I have cleaned the project, then I have deleted the entire directory boosttest-build-desktop and then "debug" built again - and the same problem occured.<br />
What more, just commenting out the line "#include &lt;boost/filesystem.hpp&gt;" and "rebuild project" makes the .exe file executable in "debug" target again. So there IS something wrong with linking but I have no idea what it can be.</p>
<p dir="auto">Thanks.</p>
]]></description><link>https://forum.qt.io/post/88184</link><guid isPermaLink="true">https://forum.qt.io/post/88184</guid><dc:creator><![CDATA[o.vencovsky]]></dc:creator><pubDate>Mon, 16 May 2011 13:00:16 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Creator, linked boost library and debug on Mon, 16 May 2011 12:36:06 GMT]]></title><description><![CDATA[<p dir="auto">That looks a lot like some stale files being left behind from one build being used in the new one.</p>
<p dir="auto">Did you clean out the build directory after switching to debug or did you use different shadow build directories for debug and release?</p>
<p dir="auto">Doing a clean rebuild should fix this.</p>
]]></description><link>https://forum.qt.io/post/88172</link><guid isPermaLink="true">https://forum.qt.io/post/88172</guid><dc:creator><![CDATA[tobias.hunger]]></dc:creator><pubDate>Mon, 16 May 2011 12:36:06 GMT</pubDate></item></channel></rss>