Question

I am using Qt Creator to rewrite my former project which is developed in Visual Studio. In this project I need to use an external library (gloox for xmpp).

Here's what I did in Visual Studio:

  1. Add c:/dir1/ to the Additional Include Directories, that's where the tons of .h and .cpp files are.
  2. Add c:/dir2/ in the linker setting, that's where the .lib file is.

I want to do the same thing in Qt Creator, so I added INCLUDEPATH += c:/dir1/ to the end of my .pro file, but when I qmaked again I still could not include anything from dir1 successfully.

#include <message.h>

C1083: Cannot open include file: 'message.h': No such file or directory

What should I do?

Was it helpful?

Solution

Based on the comment discussion, the problem seems to be that, after the INCLUDEPATH and potentially other relevant modifications, you forgot to properly re-run qmake.

This is necessary when dealing with QtCreator unfortunately due to the following long-standing issue:

Creator should know when to rerun qmake

OTHER TIPS

I found the solution: copy everything in the .pro file and delete the .pro file. Then create a new .pro file and copy everything back, then execute qmake then run.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top