Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8743785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:44:19+00:00 2026-06-13T11:44:19+00:00

I am trying to compile a simple Qt program with Code::Blocks. I am using

  • 0

I am trying to compile a simple Qt program with Code::Blocks. I am using Qt’s build system, so instead of Code::Blocks compiling it, I have Code::Blocks’ build target type set to “Commands only” and I am using the pre/post build steps options. The contents of my “Pre-build steps” are as follows:

qmake.exe GUI.pro
C:/QtSDK/mingw/bin/mingw32-make.exe -f Makefile.Debug

When I compile within Code::Blocks, I get these errors:

c:\QtSDK\Desktop\Qt\4.8.1\mingw\lib/libqtmaind.a(qtmain_win.o): In function `WinMain@16':
c:\iwmake\build_mingw_opensource\src\winmain/qtmain_win.cpp:93: undefined reference to `_Unwind_Resume'
c:\iwmake\build_mingw_opensource\src\winmain/qtmain_win.cpp:135: undefined reference to `_Unwind_Resume'
c:\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'
c:\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'
c:\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'
collect2: ld returned 1 exit status
mingw32-make.exe: *** [debug\GUI.exe] Error 1

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.

Both Code::Blocks and command line’s build logs are exactly the same (I checked), except for Code::Blocks’ errors.

It seems like qmake and the makefile don’t have anything to do with this, or at least the above happens when the makefiles don’t change.

I have made sure to delete the .o and .exe files in Debug every time I compile.

Both Code::Blocks and cmd output the same 4 files (3 .o files and 1 .cpp file), except for cmd’s .exe. However, I noticed that one file is 262kb when compiled with Code::Blocks, and 263kb when compiled via command line.

In Pre-build steps, I’ve tried calling cmd with the commands, and I’ve tried calling a batch file, but the same errors come up.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:44:20+00:00Added an answer on June 13, 2026 at 11:44 am

    Code::Blocks was using its own version of GCC, while compiling from the command line was using Qt’s version. It seems I have a fundamental misunderstanding of how makefiles work. I figured that since I was calling Qt’s MinGW make it would always use Qt’s MinGW compiler. I guess not.

    After I changed Code::Blocks’ compiler to Qt’s GCC (Settings –> Compiler and debugger –> Toolchain executables), it worked fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to compile a relatively simple c++ program using cygwin and g++. I
I’m trying to compile a very simple Hello world OpenGL 3.3 program using FreeGLUT.
I am trying to build an openssl simple program. Here is the complete code:
Trying to write simple program on Fraction operations. Can't compile the code. Getting an
I'm trying to compile the following simple DL library example code from Program-Library-HOWTO with
I'm trying to get a simple program using JOGL to compile via the command
I am trying to compile a very simple program using the -m32 flag. If
I have a very simple example program that I am trying to compile, but
I am trying to get a very simple program to compile while using functions
I'm trying to compile this simple program to start learning how to use timers:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.