{"id":3511,"date":"2014-03-27T07:52:55","date_gmt":"2014-03-27T07:52:55","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/27\/codeblocks-pre-build-options-inconsistent-with-command-line-qt-collection-of-common-programming-errors-2\/"},"modified":"2014-03-27T07:52:55","modified_gmt":"2014-03-27T07:52:55","slug":"codeblocks-pre-build-options-inconsistent-with-command-line-qt-collection-of-common-programming-errors-2","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/27\/codeblocks-pre-build-options-inconsistent-with-command-line-qt-collection-of-common-programming-errors-2\/","title":{"rendered":"Code::Blocks Pre-build options inconsistent with command line (Qt)-Collection of common programming errors"},"content":{"rendered":"<p>I am trying to compile a simple Qt program with Code::Blocks. I am using Qt&#8217;s build system, so instead of Code::Blocks compiling it, I have Code::Blocks&#8217; build target type set to &#8220;Commands only&#8221; and I am using the pre\/post build steps options. The contents of my &#8220;Pre-build steps&#8221; are as follows:<\/p>\n<pre><code>qmake.exe GUI.pro\nC:\/QtSDK\/mingw\/bin\/mingw32-make.exe -f Makefile.Debug\n<\/code><\/pre>\n<p>When I compile within Code::Blocks, I get these errors:<\/p>\n<pre><code>c:\\QtSDK\\Desktop\\Qt\\4.8.1\\mingw\\lib\/libqtmaind.a(qtmain_win.o): In function `WinMain@16':\nc:\\iwmake\\build_mingw_opensource\\src\\winmain\/qtmain_win.cpp:93: undefined reference to `_Unwind_Resume'\nc:\\iwmake\\build_mingw_opensource\\src\\winmain\/qtmain_win.cpp:135: undefined reference to `_Unwind_Resume'\nc:\\QtSDK\\Desktop\\Qt\\4.8.1\\mingw\\lib\/libqtmaind.a(qtmain_win.o):c:\\iwmake\\build_mingw_opensource\\src\\winmain\/..\/..\/include\/QtCore\/..\/..\/src\/corelib\/tools\/qvector.h:512: undefined reference to `_Unwind_Resume'\nc:\\QtSDK\\Desktop\\Qt\\4.8.1\\mingw\\lib\/libqtmaind.a(qtmain_win.o):c:\\iwmake\\build_mingw_opensource\\src\\winmain\/..\/..\/include\/QtCore\/..\/..\/src\/corelib\/tools\/qvector.h:513: undefined reference to `_Unwind_Resume'\nc:\\QtSDK\\Desktop\\Qt\\4.8.1\\mingw\\lib\/libqtmaind.a(qtmain_win.o):qtmain_win.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'\ncollect2: ld returned 1 exit status\nmingw32-make.exe: *** [debug\\GUI.exe] Error 1\n<\/code><\/pre>\n<p>However, the strange thing is, when I enter the two commands above using Windows command line, it works fine. It successfully builds a .exe that works and shows a simple window.<\/p>\n<p>Both Code::Blocks and command line&#8217;s build logs are exactly the same (I checked), except for Code::Blocks&#8217; errors.<\/p>\n<p>It seems like qmake and the makefile don&#8217;t have anything to do with this, or at least the above happens when the makefiles don&#8217;t change.<\/p>\n<p>I have made sure to delete the .o and .exe files in Debug every time I compile.<\/p>\n<p>Both Code::Blocks and cmd output the same 4 files (3 .o files and 1 .cpp file), except for cmd&#8217;s .exe. However, I noticed that one file is 262kb when compiled with Code::Blocks, and 263kb when compiled via command line.<\/p>\n<p>In Pre-build steps, I&#8217;ve tried calling cmd with the commands, and I&#8217;ve tried calling a batch file, but the same errors come up.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am trying to compile a simple Qt program with Code::Blocks. I am using Qt&#8217;s build system, so instead of Code::Blocks compiling it, I have Code::Blocks&#8217; build target type set to &#8220;Commands only&#8221; and I am using the pre\/post build steps options. The contents of my &#8220;Pre-build steps&#8221; are as follows: qmake.exe GUI.pro C:\/QtSDK\/mingw\/bin\/mingw32-make.exe -f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3511","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3511"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3511\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}