[64b-MSVC2012-OPENGL] Cannot compile subproject
-
wrote on 12 Mar 2014, 18:18 last edited by
Hello everybody. newbie to the forum
I am using Qt to build a game project with some side libraries.
To do so and to make an application that might be modular and easy to maintain, I made a separation of the differents parts building up subprojects.I am on Win 8.1 64b Pro N Edition.
Using Qt 5.2 msvc 2012 opengl 64b.
Using QtCreator as main IDE.So. Where is the problem ?
Some of my subproject depends on some others (for example, game logic depends on the game engine which depends on graphic engine, physic engine, sound engine and so on.)
Let's have a look at my project .pro file :
@TEMPLATE = subdirs
SUBDIRS +=
MadonPatcher
Madon
MLogic
MGenericRender
MGameEngine
MPhysic
MGraphicEngine
MSound
MGUI
MNetwork \MLogic.INCLUDEPATH += $$PWD/MGameEngine
MGameEngine.depends = MPhysic MSound MGUI MGraphicEngine MNetwork
MLogic.depends = MGameEngine
Madon.depends = MLogic
MadonPatcher.depends = Madonwin32-g++: COMPILER = mingw
win32-msvc2010: COMPILER = msvc
win32-msvc2012: COMPILER = msvc
linux-gcc: COMPILER = gccmessage("Compiler Binary: "$$QMAKE_CXX)
message("Compiler Type: "$${COMPILER})
@Then, here is the .pro of the problematic project :
@QT += core gui widgets
TEMPLATE = lib
BINARY_NAME= MLogic
BUILD_DIR = build
BIN_DIR = binwin32-g++: COMPILER = mingw
win32-msvc2010: COMPILER = msvc
win32-msvc2012: COMPILER = msvc
linux-gcc: COMPILER = gccmessage("Preparing "$${BINARY_NAME})
CONFIG += $${COMPILER}
SUFFIX_RELEASE = ""
SUFFIX_DEBUG= "d"
SUFFIX_COMPILER = ""$${COMPILER}unix {
DEFINES += UNIXLIBS += -L$$OUT_PWD/../MGameEngine/ -lMGameEngine
}
win32 {
DEFINES += WINDOWSmsvc { INCLUDEPATH += ./Sources/XIL INCLUDEPATH += ../MGameEngine DEPENDPATH += ../MGameEngine message($$INCLUDEPATH) }
}
CONFIG(debug, debug|release) {
CONFIG += console DEFINES += _DEBUG OBJECTS_DIR = ./$${COMPILER}/object_debug MOC_DIR = ./$${COMPILER}/moc_debug DESTDIR = ./$${COMPILER}/debug msvc { LIBS += -L../MGameEngine/msvc/debug/ -lMGameEngine_d } TARGET = $${BINARY_NAME}$${SUFFIX_DEBUG}
} else {
CONFIG -= console DEFINES += _RELEASE OBJECTS_DIR = $${COMPILER}/object_release MOC_DIR = $${COMPILER}/moc_release DESTDIR = $${COMPILER}/release msvc { LIBS += -L$$../MGameEngine/msvc/release/ -lMGameEngine } TARGET = $${BINARY_NAME}$${SUFFIX_RELEASE}
}
DEFINES += MLOGIC_LIBRARY
SOURCES += mlogic.cpp
HEADERS += mlogic.h
mlogic_global.h@And the subproject it depends from :
@QT += core opengl
QT -= guiTEMPLATE = lib
BINARY_NAME= MGameEngine
BUILD_DIR = build
BIN_DIR = binwin32-g++: COMPILER = mingw
win32-msvc2010: COMPILER = msvc
win32-msvc2012: COMPILER = msvc
linux-gcc: COMPILER = gccmessage("Preparing "$${BINARY_NAME})
CONFIG += $${COMPILER}
SUFFIX_RELEASE = ""
SUFFIX_DEBUG= "d"
SUFFIX_COMPILER = ""$${COMPILER}INCLUDEPATH += $$PWD/../MGraphicEngine
DEPENDPATH += $$PWD/../MGraphicEngineINCLUDEPATH += $$PWD/../MPhysic
DEPENDPATH += $$PWD/../MPhysicINCLUDEPATH += $$PWD/../MSound
DEPENDPATH += $$PWD/../MSoundINCLUDEPATH += $$PWD/../MGUI
DEPENDPATH += $$PWD/../MGUIINCLUDEPATH += $$PWD/../MNetwork
DEPENDPATH += $$PWD/../MNetworkunix {
DEFINES += UNIXLIBS += -L$$OUT_PWD/../MGraphicEngine/ -lMGraphicEngine LIBS += -L$$OUT_PWD/../MPhysic/ -lMPhysic LIBS += -L$$OUT_PWD/../MSound/ -lMSound LIBS += -L$$OUT_PWD/../MGUI/ -lMGUI LIBS += -L$$OUT_PWD/../MNetwork/ -lMNetwork
}
win32 {
DEFINES += WINDOWSmsvc { }
}
CONFIG(debug, debug|release) {
CONFIG += console DEFINES += _DEBUG OBJECTS_DIR = ./$${COMPILER}/object_debug MOC_DIR = ./$${COMPILER}/moc_debug DESTDIR = ./$${COMPILER}/debug msvc { LIBS += -L$$OUT_PWD/../MGraphicEngine/msvc/debug/ -lMGraphicEngine_d LIBS += -L$$OUT_PWD/../MPhysic/msvc/debug/ -lMPhysic_d LIBS += -L$$OUT_PWD/../MSound/msvc/debug/ -lMSound_d LIBS += -L$$OUT_PWD/../MGUI/msvc/debug/ -lMGUI_d LIBS += -L$$OUT_PWD/../MNetwork/msvc/debug/ -lMNetwork_d } TARGET = $${BINARY_NAME}$${SUFFIX_DEBUG}
} else {
CONFIG -= console DEFINES += _RELEASE OBJECTS_DIR = $${COMPILER}/object_release MOC_DIR = $${COMPILER}/moc_release DESTDIR = $${COMPILER}/release msvc { LIBS += -L$$OUT_PWD/../MGraphicEngine/msvc/release/ -lMGraphicEngine LIBS += -L$$OUT_PWD/../MPhysic/msvc/release/ -lMPhysic LIBS += -L$$OUT_PWD/../MSound/msvc/release/ -lMSound LIBS += -L$$OUT_PWD/../MGUI/msvc/release/ -lMGUI LIBS += -L$$OUT_PWD/../MNetwork/msvc/release/ -lMNetwork } TARGET = $${BINARY_NAME}$${SUFFIX_RELEASE}
}
DEFINES += MGAMEENGINE_LIBRARY
SOURCES += mgameengine.cpp
HEADERS += mgameengine.h
mgameengine_global.h@ -
wrote on 12 Mar 2014, 18:19 last edited by
The problem comes when i try to compile the whole thing pressing "ctrl + b".
It fails and gives me the following error :@E:\Projects\C++\Madon\Client\MLogic\mlogic.h(6) : fatal error C1083: Cannot open include file: 'mgameengine.h': No such file or directory
jom: E:\Projects\C++\Madon\Client\Madon\Makefile.Debug [msvc\object_debug\main.obj] Error 2
jom: E:\Projects\C++\Madon\Client\Madon\Makefile [debug] Error 2
jom: E:\Projects\C++\Madon\Client\Makefile [sub-Madon-make_first] Error 2
18:44:12: The process "E:\C++\Qt-5.2.0-msvc2012\Tools\QtCreator\bin\jom.exe" exited with code 2.
Error while building/deploying project MidgardAdventureOnline (kit: Desktop Qt 5.2.0 MSVC2012 OpenGL 64bit)
When executing step 'Make'@I checked the paths and include file name. Both are correct and it works when I include MLogic in Madon.
(it finds the header, etc..)So i tried to take a look at the compilation output when trying to compile MLogic.
Here is what comes out (starting at the last line of compilation of MGameEngine) :@Creating library msvc\debug\MGameEngine_d.lib and object msvc\debug\MGameEngine_d.exp
if exist msvc\debug\MGameEngine_d.dll_manifest.bak del msvc\debug\MGameEngine_d.dll_manifest.bak
cd MLogic\ && ( if not exist Makefile E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\bin\qmake.exe E:\Projects\C++\Madon\Client\MLogic\MLogic.pro -spec win32-msvc2012 CONFIG+=debug -o Makefile ) && E:\C++\Qt-5.2.0-msvc2012\Tools\QtCreator\bin\jom.exe -f Makefile
E:\C++\Qt-5.2.0-msvc2012\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWIN32 -DWIN64 -DWINDOWS -D_DEBUG -DMLOGIC_LIBRARY -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I".\Sources\XIL" -I"..\MGameEngine" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include\QtWidgets" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include\QtGui" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include\QtCore" -I"msvc\moc_debug" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\mkspecs\win32-msvc2012" -Fomsvc\object_debug\ @C:\Users\Erio\AppData\Local\Temp\mlogic.obj.22004.15.jom
mlogic.cpp
E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\bin\moc.exe -DUNICODE -DWIN32 -DWIN64 -DWINDOWS -D_DEBUG -DMLOGIC_LIBRARY -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 -D_WIN64 -I".\Sources\XIL" -I"..\MGameEngine" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include\QtWidgets" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include\QtGui" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include\QtCore" -I"msvc\moc_debug" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\mkspecs\win32-msvc2012" mlogic.h -o msvc\moc_debug\moc_mlogic.cpp
cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWIN32 -DWIN64 -DWINDOWS -D_DEBUG -DMLOGIC_LIBRARY -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I".\Sources\XIL" -I"..\MGameEngine" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include\QtWidgets" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include\QtGui" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include\QtCore" -I"msvc\moc_debug" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\mkspecs\win32-msvc2012" -Fomsvc\object_debug\ @C:\Users\Erio\AppData\Local\Temp\moc_mlogic.obj.22004.93.jom
moc_mlogic.cpp
echo 2 /* CREATEPROCESS_MANIFEST_RESOURCE_ID / 24 / RT_MANIFEST */ "msvc\debug\MLogic_d.dll.embed.manifest">msvc\debug\MLogic_d.dll_manifest.rc
if not exist msvc\debug\MLogic_d.dll if exist msvc\debug\MLogic_d.dll.embed.manifest del msvc\debug\MLogic_d.dll.embed.manifest
if exist msvc\debug\MLogic_d.dll.embed.manifest copy /Y msvc\debug\MLogic_d.dll.embed.manifest msvc\debug\MLogic_d.dll_manifest.bak
link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /DLL /MANIFEST /MANIFESTFILE:msvc\debug\MLogic_d.dll.embed.manifest /OUT:msvc\debug\MLogic_d.dll @C:\Users\Erio\AppData\Local\Temp\MLogic_d.dll.22004.890.jom
Creating library msvc\debug\MLogic_d.lib and object msvc\debug\MLogic_d.exp
if exist msvc\debug\MLogic_d.dll_manifest.bak fc /b msvc\debug\MLogic_d.dll.embed.manifest msvc\debug\MLogic_d.dll_manifest.bak >NUL || del msvc\debug\MLogic_d.dll_manifest.bak
if not exist msvc\debug\MLogic_d.dll_manifest.bak rc.exe /fomsvc\debug\MLogic_d.dll_manifest.res msvc\debug\MLogic_d.dll_manifest.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.2.9200.16384Copyright (C) Microsoft Corporation. All rights reserved.
if not exist msvc\debug\MLogic_d.dll_manifest.bak link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /DLL /MANIFEST /MANIFESTFILE:msvc\debug\MLogic_d.dll.embed.manifest /OUT:msvc\debug\MLogic_d.dll @C:\Users\Erio\AppData\Local\Temp\MLogic_d.dll.22004.906.jom
Creating library msvc\debug\MLogic_d.lib and object msvc\debug\MLogic_d.exp
if exist msvc\debug\MLogic_d.dll_manifest.bak del msvc\debug\MLogic_d.dll_manifest.bak
cd Madon\ && ( if not exist Makefile E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\bin\qmake.exe E:\Projects\C++\Madon\Client\Madon\Madon.pro -spec win32-msvc2012 CONFIG+=debug -o Makefile ) && E:\C++\Qt-5.2.0-msvc2012\Tools\QtCreator\bin\jom.exe -f Makefile
E:\C++\Qt-5.2.0-msvc2012\Tools\QtCreator\bin\jom.exe -f Makefile.Debug -
wrote on 12 Mar 2014, 18:19 last edited by
cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWIN32 -DWIN64 -DWINDOWS -D_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I"..\MLogic" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include\QtWidgets" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include\QtGui" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\include\QtCore" -I"msvc\moc_debug" -I"E:\C++\Qt-5.2.0-msvc2012\5.2.0\msvc2012_64_opengl\mkspecs\win32-msvc2012" -Fomsvc\object_debug\ @C:\Users\Erio\AppData\Local\Temp\main.obj.13868.16.jom
main.cpp
E:\Projects\C++\Madon\Client\MLogic\mlogic.h(6) : fatal error C1083: Cannot open include file: 'mgameengine.h': No such file or directory@I don't see the -I"..\GameEngine" everywhere. So i really don't have a clue of what is the problem.
On the other side, Qtcreator recognize the file and even allows me to create the objects it contains.The problem is exactly the same with the includes in GameEngine, when i try to include an header. It makes the compilation crash, even if i can code and auto-complete, etc my code.
As you can see. It seems that the problem comes from qmake when building the whole tree.
(and yes. I re-runned qmake).Important remark !
If i compile Mlogic alone. It works.If someone have an idea or wants to help a bit on this really strange but. Thanks. :)
Erio
-
wrote on 12 Mar 2014, 23:42 last edited by
Hm.. Well. I am sorry. I solved the problem..
In fact. It came from Madon while using and including MLogic.
main.cpp includes mlogic.h... Which one includes mgameengine.h
This seems legit.. But !
MLogic project posses the INCLUDEPATH to mgameengine.h, Madon doesn't!
So it becomes pretty logic that it doesn't find mgameengine.h but that Qtcreator does (as qtcreator bases itself on .pro files. Compiler does not.)Here is my question.
Is it possible to inherit the INCLUDEPATH of these libraries ?
I mean i can do Madon.INCLUDEPATH += MLogic.INCLUDEPATH ... But is it the best solution ?
Thanks in advance !
-
wrote on 12 Mar 2014, 23:52 last edited by
@TEMPLATE = subdirs
SUBDIRS +=
MadonPatcher
Madon
MLogic
MGenericRender
MGameEngine
MPhysic
MGraphicEngine
MSound
MGUI
MNetwork \MGameEngine.depends = MPhysic MSound MGUI MGraphicEngine MNetwork
MLogic.depends = MGameEngine
Madon.depends = MLogic
MadonPatcher.depends = MadonMGameEngine.INCLUDEPATH += MPhysic.INCLUDEPATH
MGameEngine.INCLUDEPATH += MSound.INCLUDEPATH
MGameEngine.INCLUDEPATH += MGUI.INCLUDEPATH
MGameEngine.INCLUDEPATH += MGraphicEngine.INCLUDEPATH
MGameEngine.INCLUDEPATH += MNetwork.INCLUDEPATHMLogic.INCLUDEPATH += MGameEngine.INCLUDEPATH
Madon.INCLUDEPATH += MLogic.INCLUDEPATH
win32-g++: COMPILER = mingw
win32-msvc2010: COMPILER = msvc
win32-msvc2012: COMPILER = msvc
linux-gcc: COMPILER = gccmessage("Compiler Binary: "$$QMAKE_CXX)
message("Compiler Type: "$${COMPILER})
@Ok. This doesn't work for INCLUDEPATH...
Any idea ? :)
1/5