Search code examples
qtdebuggingqt-creatorstatic-linking

Qt error cannot find -lQtCored collect2: ld returned 1 exit status


I am getting the following error, when I run programs in debug mode.

cannot find -lQtCored 
collect2: ld returned 1 exit status

I can run programs normally in release mode. Is it because I have done static linking (I can run my executable without Qt Creator)? I am using Qt Creator with Qt 4.7.0 on Windows.


Solution

  • Your linker can not see debug library of QtCore (as shown - -lQtCored, release lib - -lQtCore). You need checked, really you build this debug library or not, then checked all pathes to this debug library.

    PS. Yes, you can run executable without Qt-Creator. You should use qmake (into directory with your .pro) and make (when your qmake has generate Makefile).

    PSS. If you want to run .exe then you should put some Qt libraries into directory with .exe.