Getting a .pro file to work for both Visual Studio 2008 and Qt Creator
Page |
1 |
I am working on my first QML project. I was worked with the .pro file created by QtCreator to get the initial UI and all worked well. That .pro file would compile and run in VS2008.
Now it is time to start adding in the biz logic from the old Qt program, where things like the sql module and precompiled headers are needed. After adding all the new values to the .pro file, VS2008 is still able to compile, debug, and run the application. But when I open the .pro file in Qt Creator I get the following error.
I hit the 6000 char max so will post the .pro file in the first reply. Any thoughts?
{MOC COMMON PARAMS} -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_LARGEILE_SUPPORT -DQT_SQL_LIB -D_USE_32BIT_TIME_T -DNETWORKACCESS -DQT_DLL -DQT_DECLARATIVE_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I”..\..\..\..\Qt\4.7.1\include\QtCore” -I”..\..\..\..\Qt\4.7.1\include\QtGui” -I”..\..\..\..\Qt\4.7.1\include\QtSql” -I”..\..\..\..\Qt\4.7.1\include\QtDeclarative” -I”..\..\..\..\Qt\4.7.1\include” -I”.\..\..\..\..\include” -I”..\SalesCenter\GeneratedFiles” -I”..\SalesCenter” -I”..\SalesCenter\GeneratedFiles\Debug” -I”..\SalesCenter\qmlapplicationviewer” -I”..\..\..\..\Qt\4.7.1\include\ActiveQt” -I“GeneratedFiles\Debug” -I”.” -I”..\..\..\..\Qt\4.7.1\mkspecs\win32-msvc2008” -D_MSC_VER=1500 -DWIN32
{CL COMMON PARAMS}: c -FIstdafx.h -Yustdafx.h -FpDebug\SalesCenter_pch.pch -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_LARGEILE_SUPPORT -DQT_SQL_LIB -D_USE_32BIT_TIME_T -DNETWORKACCESS -DQT_DLL -DQT_DECLARATIVE_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I”..\..\..\..\Qt\4.7.1\include\QtCore” -I”..\..\..\..\Qt\4.7.1\include\QtGui” -I”..\..\..\..\Qt\4.7.1\include\QtSql” -I”..\..\..\..\Qt\4.7.1\include\QtDeclarative” -I”..\..\..\..\Qt\4.7.1\include” -I”.\..\..\..\..\include” -I”..\SalesCenter\GeneratedFiles” -I”..\SalesCenter” -I”..\SalesCenter\GeneratedFiles\Debug” -I”..\SalesCenter\qmlapplicationviewer” -I”..\..\..\..\Qt\4.7.1\include\ActiveQt” -I“GeneratedFiles\Debug” -I”.” -I”..\..\..\..\Qt\4.7.1\mkspecs\win32-msvc2008” -FoDebug\
- Running build steps for project SalesCenter...
- Configuration unchanged, skipping qmake step.
- Starting: "D:\Qt\qtcreator-2.0.94\bin\jom.exe"
- cl -c -Yc -FpDebug\SalesCenter_pch.pch -FoDebug\SalesCenter_pch.obj -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_LARGEILE_SUPPORT -DQT_SQL_LIB -D_USE_32BIT_TIME_T -DNETWORKACCESS -DQT_DLL -DQT_DECLARATIVE_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\..\..\Qt\4.7.1\include\QtCore" -I"..\..\..\..\Qt\4.7.1\include\QtGui" -I"..\..\..\..\Qt\4.7.1\include\QtSql" -I"..\..\..\..\Qt\4.7.1\include\QtDeclarative" -I"..\..\..\..\Qt\4.7.1\include" -I".\..\..\..\..\include" -I"..\SalesCenter\GeneratedFiles" -I"..\SalesCenter" -I"..\SalesCenter\GeneratedFiles\Debug" -I"..\SalesCenter\qmlapplicationviewer" -I"..\..\..\..\Qt\4.7.1\include\ActiveQt" -I"GeneratedFiles\Debug" -I"." -I"..\..\..\..\Qt\4.7.1\mkspecs\win32-msvc2008" -TP ..\SalesCenter\stdafx.h
- stdafx.h
- D:\Qt\4.7.1\bin\moc.exe {MOC COMMON PARAMS} ..\SalesCenter\qmlapplicationviewer\qmlapplicationviewer.h -o GeneratedFiles\Debug\moc_qmlapplicationviewer.cpp
- D:\Qt\4.7.1\bin\moc.exe {MOC COMMON PARAMS} ..\SalesCenter\DBManager.h -o GeneratedFiles\Debug\moc_DBManager.cpp
- D:\Qt\4.7.1\bin\moc.exe {MOC COMMON PARAMS} ..\SalesCenter\SystemSettings.h -o GeneratedFiles\Debug\moc_SystemSettings.cpp
- Copying application data...
- 56 File(s) copied
- D:\MSDev\PhotoParata\Qt\SalesCenter\GeneratedFiles\../../../Services/WSCommonLib/constants.h(33) : warning C4005: 'PRICELISTID' : macro redefinition
- cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\qmlapplicationviewer.obj.3588.2964.jom
- qmlapplicationviewer.cpp
- cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\DBManager.obj.3588.2995.jom
- DBManager.cpp
- cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\main.obj.3588.3026.jom
- main.cpp
- ..\SalesCenter\main.cpp(16) : warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
- C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\stdlib.h(447) : see declaration of 'getenv'
- cl <COMMON PARAMS> @C:\Users\sam\AppData\Local\Temp\stdafx.obj.3588.3058.jom
- stdafx.cpp
- Compiled with QT 4.7.1
- cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\SystemSettings.obj.3588.3089.jom
- SystemSettings.cpp
- cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\moc_qmlapplicationviewer.obj.3588.3120.jom
- moc_qmlapplicationviewer.cpp
- cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\moc_DBManager.obj.3588.3151.jom
- moc_DBManager.cpp
- cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\moc_SystemSettings.obj.3588.3182.jom
- moc_SystemSettings.cpp
- link /LIBPATH:"d:\Qt\4.7.1\lib" /NOLOGO /DEBUG /MANIFEST /MANIFESTFILE:"Debug\SalesCenter.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:..\Debug\SalesCenter.exe @C:\Users\sam\AppData\Local\Temp\SalesCenter.exe.3588.3245.jom
- mt.exe -nologo -manifest "Debug\SalesCenter.intermediate.manifest" -outputresource:..\Debug\SalesCenter.exe;1
- Copying application data...
- 56 File(s) copied
- jom 0.9.4 - empower your cores
- The process "D:\Qt\qtcreator-2.0.94\bin\jom.exe" exited normally.
21 replies
The .pro file:
- # Add more folders to ship with the application, here
- folder_01.source = qml/SalesCenter
- folder_01.target = qml
- DEPLOYMENTFOLDERS = folder_01
- # Additional import path used to resolve QML modules in Creator's code model
- QML_IMPORT_PATH =
- # Avoid auto screen rotation
- #DEFINES += ORIENTATIONLOCK
- # Needs to be defined for Symbian
- QT += sql
- CONFIG += debug_and_release
- DEFINES += QT_LARGEILE_SUPPORT QT_SQL_LIB _USE_32BIT_TIME_T NETWORKACCESS
- QTPLUGIN += qjpeg
- INCLUDEPATH += ./../../../../include ./GeneratedFiles .
- PRECOMPILED_HEADER = stdafx.h
- UI_DIR += ./GeneratedFiles
- RCC_DIR += ./GeneratedFiles
- CONFIG(debug, debug|release) {
- DESTDIR = ../Debug
- LIBS += -L../Debug
- OBJECTS_DIR += Debug
- MOC_DIR += ./GeneratedFiles/Debug
- INCLUDEPATH += ./GeneratedFiles/Debug
- } else {
- DESTDIR = ../Release
- LIBS += -L../Release
- OBJECTS_DIR += Release
- MOC_DIR += ./GeneratedFiles/Release
- INCLUDEPATH += ./GeneratedFiles/Release
- }
- symbian:TARGET.UID3 = 0xE46A320F
- # Smart Installer package's UID
- # This UID is from the protected range
- # and therefore the package will fail to install if self-signed
- # By default qmake uses the unprotected range value if unprotected UID is defined for the application
- # and 0x2002CCCF value if protected UID is given to the application
- #symbian:DEPLOYMENT.installer_header = 0x2002CCCF
- # Define QMLJSDEBUGGER to allow debugging of QML in debug builds
- # (This might significantly increase build time)
- # DEFINES += QMLJSDEBUGGER
- # If your application uses the Qt Mobility libraries, uncomment
- # the following lines and add the respective components to the
- # MOBILITY variable.
- # CONFIG += mobility
- # MOBILITY +=
- # The .cpp file which was generated for your project. Feel free to hack it.
- # Please do not modify the following two lines. Required for deployment.
- include(qmlapplicationviewer/qmlapplicationviewer.pri)
- qtcAddDeployment()
- include(SalesCenter.pri)
Why is it sometime folks cannot see the obvious! It is working fine, the error message I get from running it is my applications obscure message that the correct command line parameters where not passed in. Now to figure out how to set command line options for debugging!
Sorry, I cannot see any kind of error message. At worst some compiler warnings.
Scarleton, VCsala: Any ideas for a better place to put those settings? I thought the place they are now is rather obvious…Once I started to really look for it, it was obvious. But then I am coming from the Visual Studio world. The very first place I looked for it was by right clicking on the very root of the solution tree and looked for Project Settings.
What would be cool is if that option exists and when the user clicked on it that way, the <Projects> button on the left would flash as it became active to draw folks attention to it. Hopefully one or two times folks would get with the program.
Sam
scarleton: I actually like that idea:-) I’ll look into it once I find some time to do so. I am currently a bit busy refactoring some code and want to get that done first.
Maybe you could file your suggestion in our issue tracker [bugreports.qt.nokia.com] so it won’t be forgotten?
You must log in to post a reply. Not a member yet? Register here!






