title: Qt program fails to compile/has runtime error (IDE: CodeBlocks/QtCreator)
body: <p>I am new to Qt. While I have installed 4.8.3 for long, I started writing my first Qt program yesterday. I am under windows environment, and use CodeBlocks for my C++ codes.</p>
  
  <p>I followed the book on Qt programming, and tried to reproduce the book examples. Problem arose in the second chapter, when there was a need of separate compilation. I never had a successful separate compilation with CodeBlocks, and no exception this time: I still received "unknown reference to XXX".</p>
  
  <p>I tried to find all instructions online but I still could not solve it (set up qmake, linking etc.) Especially when I used qmake and mark the makefile as custom one, whenever I compiled my program, CodeBlocks told me that the project hadnt been built; when I clicked "yes" for building the program, the same "hasnt been built" notification popped out, and the process repeated.</p>
  
  <p>I once suspected that something went wrong with my Qt, so I removed it and installed the latest one (which is Qt5.0). But I could not use it because CodeBlocks only supports Qt4, and my compiler does not support Qt5.</p>
  
  <p>So I tried to download the "old one", 4.8.4. Then it turned out that I could not even compile a one-file program (I mean one .cpp file in the whole project, no self-defined header). I tried the default CodeBlock qt program, which is like this:</p>
  
  <pre><code>    #include &lt;QApplication&gt;
      #include &lt;QFont&gt;
      #include &lt;QPushButton&gt;
  
      int main(int argc, char* argv[])
      {
          QApplication app(argc, argv);
          QPushButton quit("Quit");
          quit.resize(75, 30);
          quit.setFont(QFont("Times", 18, QFont::Bold));
          QObject::connect(&amp;quit, SIGNAL(clicked()), &amp;app, SLOT(quit()));
          quit.show();
          return app.exec();
      }
  </code></pre>
  
  <p>Just a very standard one. It should compile, and it did, but things were even worse: the program never works, as runtime error occurs right after it is executed (error code: 0xC0000005 or -1073741819)
  This is my problem 1: I have no clues, what can I do to solve the problem? I do not mind deleting my CodeBlocks and Qt and doing the reinstallation if they work, but I have tried, and no use.</p>
  
  <p>My second problem: (this is solved)
  Then I tried to use Qt Creator. When I compiled the simple program shown above, I received a lot of errors with keywords "unwind_resume" - can anyone tell me how I can solve it? (Online comments suggest running qtvar.bat, but it didnt help; some suggested building debug library, which I tried but accidentally stopped because of not enough memory?)</p>
  
  <p>My third problem: (found it rather redundant because it is discussed above, so I have deleted it)</p>
  
  <p>(I should say thanks first to people who really read my post. And I have to say that while information provided may not be sufficient for finding solution, this is all I know.)</p>
  
  <p>Update - Some more info: actually I also had similar undefined reference for CodeBlocks. But I was lazy and so I just copied all the .dll files from the qt folder to the SysWOW64; programs did compile and run yesterday, but programs crashed with runtime error after I reinstalled qt and codeblocks today, even though I also copied the new .dll files. To make things clear: Codeblocks can compile the program if I copy the .dll files to SysWOW64, but now the program crashes, unlike yesterday as the program ran normally.)</p>
  
  <p>Update - now the problem is runtime error.</p>