Building on Windows requires INCLUDEPATH += .
-
I have been working on an application on Linux, and I was working on Linux today. I have a bunch of classes in subdirectories of the project's root. (i.e., $PROJECT/audio/myaudioclass.h). When I first tried to build on Windows, I got build errors on the includes. Doing "Follow symbol under cursor" in the editor would go to the header file without any problem. I added "INCLUDEPATH += ." to my .pro file, and that made the problem go away. But, I still don't really understand why I ran into this issue. Is this expected behavior on Windows vs. Linux, or have I just got something screwed up in the configuration? Has anybody run into this sort of thing before?
-
Hi,
Could you show your pro file and the folder structure of your project ?
-
This is the .pro file I am currently building with. (Some of the cpp and h files have been trimmed for brevity, but this should be enough for the gist.) If I comment out the INCLUDEPATH line that adds ., I get "fatal error C1083: Cannot open include file: 'audio/tlaudiobuffer.h': No such file or directory"
Building with MSVC 2012 32 bit. (Same behavior with 64 bit, with adjustments to paths to get the 64 bit builds of the relevant libraries)
@#-------------------------------------------------
Project created by QtCreator 2013-09-12T18:18:14
#-------------------------------------------------
QT += core gui multimedia
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Timelines
TEMPLATE = appSOURCES += main.cpp
mainwindow.cpp
ui/tlviewer.cpp
audio/tlaudiooutput.cpp
audio/tlaudioqtoutput.cpp
audio/tlaudiobuffer.cpp
ui/tleditorwindow.cpp
io/tljsonfileio.cppHEADERS += mainwindow.h
ui/tlviewer.h
audio/tlaudiooutput.h
audio/tlaudioqtoutput.h
audio/tlaudiobuffer.h
ui/tleditorwindow.h
io/tljsonfileio.hFORMS += mainwindow.ui
unix:LIBS += -L/usr/local/lib -lffms2
unix:INCLUDEPATH += /usr/local/include/
win32:INCLUDEPATH += .
win32:INCLUDEPATH += C:/Users/will/Documents/development/ffms/include
win32:LIBS += C:/Users/will/Documents/development/ffms/build-msvc/win32/Debug/ffms2.lib "C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86/Ole32.lib"@
-
Well, I must say that I'm surprised that you didn't had the same problem on linux.
Could you diff the two Makefiles generated to see the differences in the include path ? Also, are you using the same Qt/QtCreator combo on both platforms ?
-
I did have a different Qt version between Windows and Linux, but I have since upgraded both to 5.1 and it's still something I only see on Windows. In any event, the application has grown a bit and the .pro is now split out into a .pro and some .pri. It's all building as long as I have the win32:INCLUDEPATH line in there. I don't have another Windows box to test with at the moment for comparison, so I am willing to consider it just something weirdly configured on that machine.