Note that there are some explanatory texts on larger screens.

plurals
  1. POError using Qt 5.1.1 in code::blocks
    primarykey
    data
    text
    <p>I am trying to combine Code::Blocks IDE and Qt 5.1.1 on my win7 32bit. In CB I use MinGW's g++ compiler which supports C++0x.<br> I downloaded "qt-windows-opensource-5.1.1-mingw48_opengl-x86-offline.exe" and installed at "D:\Qt-library\5.1.1\mingw48_32\". </p> <p>Then in CB I added three tools named "qmake -project" , "qmake" and "make" at Tools->Configure tools->add.<br> "qmake -project" with Executable "D:\Qt-library\5.1.1\mingw48_32\bin\qmake.exe", Parameters: "-project -platform win32-g++"<br> "qmake" with Excutable same as "qmake -project", no parameter;<br> "make" with Excutable "D:\Qt-library\Tools\mingw48_32\bin\mingw32-make.exe", no parameter<br> Working directory all set to "${PROJECT_DIR}"</p> <p>And I clicked project->properties, selected "This is a custom Makefile"</p> <p>Then I clickd the "qmake -project" menu item in Tools menu which I created as above, qmake generated a .pro file.<br> Because I use</p> <pre><code> #include &lt;QApplication&gt; </code></pre> <p>instead of</p> <pre><code> #include &lt;QtGui/QApplication&gt; </code></pre> <p>in main.cpp file so I added "QT += widgets" in the .pro file.<br> Then click "qmake" in Tools menu, makefiles are generated. If I directly make, it won't compile, because it doesn't support some C++11 grammars,<br> so I edited the Makefile.Debug and makefile.Release, it looks like:</p> <pre><code> CC = gcc CXX = g++ DEFINES = -DUNICODE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN CFLAGS = -pipe -fno-keep-inline-dllexport -O2 -Wall -Wextra $(DEFINES) CXXFLAGS = -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexceptions -mthreads $(DEFINES) </code></pre> <p>I added -std=c++0x at the line CXXFLAGS, so it become</p> <pre><code> CXXFLAGS = -pipe -std=c++0x -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexceptions -mthreads $(DEFINES) </code></pre> <p>(it won't work for my version of MinGW if I use -std=c++11)</p> <p>Then click "make" in the Tools menu, I get two errors:<br> <img src="https://i.stack.imgur.com/VYe4r.png" alt="qMain error"></p> <p>I don't know what the hell was that but some how I modified my main function from <code>int main(int argc, char** argv)</code> to <code>int qMain(int argc, char** argv)</code>. Then make again, the two qMain error disappeared but I got this: <img src="https://i.stack.imgur.com/2218i.jpg" alt="permission denied error"></p> <p>And now, I didn't do any thing, make again, that error disappeared !!! But generated .exe file won't do anything, either double click or run in command line, nothing would happen (by the way, although I included , I didn't write any Qt code) If I remove</p> <pre><code> #include &lt;QApplication&gt; </code></pre> <p>and build the project in normal way(cancel "This is a custom Makefile" and build directly), my program goes well.</p> <p>Another thing very weird, I added <code>CONFIG += debug</code> and <code>CONFIG -= release</code> in the .pro file, qmake will generate both Makefile.Debug and Makefile.Release(whatever CONFIG or debug and release is uper or lower case), but generated .o files and .exe files are all in release directory, no debug file, why was that ?</p> <p>Anyone has any ideas ? I'll be very thankful for your suggestions.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload