December 18, 2010

scarleton scarleton
Lab Rat
117 posts

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\

  1. Running build steps for project SalesCenter...
  2. Configuration unchanged, skipping qmake step.
  3. Starting: "D:\Qt\qtcreator-2.0.94\bin\jom.exe"
  4. D:\Qt\qtcreator-2.0.94\bin\jom.exe -nologo -j 8 -f Makefile.Debug
  5. 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
  6. stdafx.h
  7. D:\Qt\4.7.1\bin\moc.exe {MOC COMMON PARAMS} ..\SalesCenter\qmlapplicationviewer\qmlapplicationviewer.h -o GeneratedFiles\Debug\moc_qmlapplicationviewer.cpp
  8. D:\Qt\4.7.1\bin\moc.exe {MOC COMMON PARAMS} ..\SalesCenter\DBManager.h -o GeneratedFiles\Debug\moc_DBManager.cpp
  9. D:\Qt\4.7.1\bin\moc.exe {MOC COMMON PARAMS} ..\SalesCenter\SystemSettings.h -o GeneratedFiles\Debug\moc_SystemSettings.cpp
  10. Copying application data...
  11. 56 File(s) copied
  12. D:\MSDev\PhotoParata\Qt\SalesCenter\GeneratedFiles\../../../Services/WSCommonLib/constants.h(33) : warning C4005: 'PRICELISTID' : macro redefinition
  13.         d:\msdev\photoparata\qt\salescenter\DBManager.h(27) : see previous definition of 'PRICELISTID'
  14. cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\qmlapplicationviewer.obj.3588.2964.jom
  15. qmlapplicationviewer.cpp
  16. cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\DBManager.obj.3588.2995.jom
  17. DBManager.cpp
  18. cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\main.obj.3588.3026.jom
  19. main.cpp
  20. ..\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.
  21.         C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\stdlib.h(447) : see declaration of 'getenv'
  22. cl <COMMON PARAMS> @C:\Users\sam\AppData\Local\Temp\stdafx.obj.3588.3058.jom
  23. stdafx.cpp
  24. Compiled with QT 4.7.1
  25. cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\SystemSettings.obj.3588.3089.jom
  26. SystemSettings.cpp
  27. cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\moc_qmlapplicationviewer.obj.3588.3120.jom
  28. moc_qmlapplicationviewer.cpp
  29. cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\moc_DBManager.obj.3588.3151.jom
  30. moc_DBManager.cpp
  31. cl {CL COMMON PARAMS} @C:\Users\sam\AppData\Local\Temp\moc_SystemSettings.obj.3588.3182.jom
  32. moc_SystemSettings.cpp
  33. 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
  34. mt.exe -nologo -manifest "Debug\SalesCenter.intermediate.manifest" -outputresource:..\Debug\SalesCenter.exe;1
  35. Copying application data...
  36. 56 File(s) copied
  37.  
  38. jom 0.9.4 - empower your cores
  39.  
  40. The process "D:\Qt\qtcreator-2.0.94\bin\jom.exe" exited normally.

21 replies

December 18, 2010

scarleton scarleton
Lab Rat
117 posts

The .pro file:

  1. # Add more folders to ship with the application, here
  2. folder_01.source = qml/SalesCenter
  3. folder_01.target = qml
  4. DEPLOYMENTFOLDERS = folder_01
  5.  
  6. # Additional import path used to resolve QML modules in Creator's code model
  7. QML_IMPORT_PATH =
  8.  
  9. # Avoid auto screen rotation
  10. #DEFINES += ORIENTATIONLOCK
  11.  
  12. # Needs to be defined for Symbian
  13.  
  14. QT += sql
  15. CONFIG += debug_and_release
  16. DEFINES += QT_LARGEILE_SUPPORT QT_SQL_LIB _USE_32BIT_TIME_T NETWORKACCESS
  17. QTPLUGIN  += qjpeg
  18. INCLUDEPATH += ./../../../../include ./GeneratedFiles .
  19. PRECOMPILED_HEADER = stdafx.h
  20. UI_DIR += ./GeneratedFiles
  21. RCC_DIR += ./GeneratedFiles
  22.  
  23. CONFIG(debug, debug|release) {
  24.  DESTDIR = ../Debug
  25.  LIBS += -L../Debug
  26.  OBJECTS_DIR += Debug
  27.  MOC_DIR += ./GeneratedFiles/Debug
  28.  INCLUDEPATH += ./GeneratedFiles/Debug
  29. } else {
  30.  DESTDIR = ../Release
  31.  LIBS += -L../Release
  32.  OBJECTS_DIR += Release
  33.  MOC_DIR += ./GeneratedFiles/Release
  34.  INCLUDEPATH += ./GeneratedFiles/Release
  35. }
  36.  
  37. symbian:TARGET.UID3 = 0xE46A320F
  38.  
  39. # Smart Installer package's UID
  40. # This UID is from the protected range
  41. # and therefore the package will fail to install if self-signed
  42. # By default qmake uses the unprotected range value if unprotected UID is defined for the application
  43. # and 0x2002CCCF value if protected UID is given to the application
  44. #symbian:DEPLOYMENT.installer_header = 0x2002CCCF
  45.  
  46. # Define QMLJSDEBUGGER to allow debugging of QML in debug builds
  47. # (This might significantly increase build time)
  48. # DEFINES += QMLJSDEBUGGER
  49.  
  50. # If your application uses the Qt Mobility libraries, uncomment
  51. # the following lines and add the respective components to the
  52. # MOBILITY variable.
  53. # CONFIG += mobility
  54. # MOBILITY +=
  55.  
  56. # The .cpp file which was generated for your project. Feel free to hack it.
  57.  
  58. # Please do not modify the following two lines. Required for deployment.
  59. include(qmlapplicationviewer/qmlapplicationviewer.pri)
  60. qtcAddDeployment()
  61.  
  62. include(SalesCenter.pri)

December 18, 2010

Milot Shala Milot Shala
Lab Rat
396 posts

Do you get the error during opening or compilation?

December 18, 2010

scarleton scarleton
Lab Rat
117 posts

compilation

December 18, 2010

Tobias Hunger Tobias Hunger
Area 51 Engineer
3383 posts

Sorry, where is the actual error in that output? I only see a couple of warnings.

There is a undocumented qgetenv in the QtCore/QtGlobal header by the way:-)

December 18, 2010

scarleton scarleton
Lab Rat
117 posts

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!

December 18, 2010

Gerolf Gerolf
Robot Herder
3235 posts

For QtCreator:

Go to Projects —> run settings —> add the parameters you need :-)

For MSVS

Go To vcproj properties —> debug —> add the command line parameters

 Signature 

Nokia Certified Qt Specialist.
Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

December 18, 2010

VCsala VCsala
Lab Rat
339 posts

Gerolf, maybe it is funny, but after several months developing on Qt, few days ago I have started to write a command line tool and it took me several hours to find this setting in Qt Creator… :)

December 18, 2010

Gerolf Gerolf
Robot Herder
3235 posts

I also looked longer for those options the first time. also how to change the project build parameters :-)

 Signature 

Nokia Certified Qt Specialist.
Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

December 18, 2010

Volker Volker
Ant Farmer
5428 posts
scarleton wrote:
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.

December 18, 2010

Tobias Hunger Tobias Hunger
Area 51 Engineer
3383 posts

Scarleton, VCsala: Any ideas for a better place to put those settings? I thought the place they are now is rather obvious…

December 18, 2010

VCsala VCsala
Lab Rat
339 posts

After all it is obvious, it was my fault, as I was developing in different environments for years and it took some time to regain my aquaintance with these kind of IDE tools.

December 18, 2010

scarleton scarleton
Lab Rat
117 posts

Tobias Hunger wrote:
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

December 19, 2010

Gerolf Gerolf
Robot Herder
3235 posts

That’s right for us MSVS people. But how is it for KDE or other IDEs?
Personally, I like context menus and options there and it could help to have an additional entry forwarding to the projects page, yes.

 Signature 

Nokia Certified Qt Specialist.
Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

December 19, 2010

Tobias Hunger Tobias Hunger
Area 51 Engineer
3383 posts

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?

December 19, 2010

VCsala VCsala
Lab Rat
339 posts
Gerolf Reinwardt wrote:
Personally, I like context menus and options there and it could help to have an additional entry forwarding to the projects page, yes.

Exactly, this is what I missed at the beginning, right clicking on a project and reach all related properties.

Page  
1

  ‹‹ Organizing program code      background for images with alpha channel ››

You must log in to post a reply. Not a member yet? Register here!