Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Getting a .pro file to work for both Visual Studio 2008 and Qt Creator
Forum Updated to NodeBB v4.3 + New Features

Getting a .pro file to work for both Visual Studio 2008 and Qt Creator

Scheduled Pinned Locked Moved General and Desktop
22 Posts 7 Posters 11.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    scarleton
    wrote on last edited by
    #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"
    D:\Qt\qtcreator-2.0.94\bin\jom.exe -nologo -j 8 -f Makefile.Debug
    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
    d:\msdev\photoparata\qt\salescenter\DBManager.h(27) : see previous definition of 'PRICELISTID'
    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.@

    1 Reply Last reply
    0
    • S Offline
      S Offline
      scarleton
      wrote on last edited by
      #2

      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)@

      1 Reply Last reply
      0
      • M Offline
        M Offline
        milot.shala
        wrote on last edited by
        #3

        Do you get the error during opening or compilation?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          scarleton
          wrote on last edited by
          #4

          compilation

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tobias.hunger
            wrote on last edited by
            #5

            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:-)

            1 Reply Last reply
            0
            • S Offline
              S Offline
              scarleton
              wrote on last edited by
              #6

              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!

              1 Reply Last reply
              0
              • G Offline
                G Offline
                giesbert
                wrote on last edited by
                #7

                For QtCreator:

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

                For MSVS

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

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

                1 Reply Last reply
                0
                • V Offline
                  V Offline
                  vcsala
                  wrote on last edited by
                  #8

                  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... :)

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    giesbert
                    wrote on last edited by
                    #9

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

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

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #10

                      [quote author="scarleton" date="1292697100"]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![/quote]

                      Sorry, I cannot see any kind of error message. At worst some compiler warnings.

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • T Offline
                        T Offline
                        tobias.hunger
                        wrote on last edited by
                        #11

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

                        1 Reply Last reply
                        0
                        • V Offline
                          V Offline
                          vcsala
                          wrote on last edited by
                          #12

                          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.

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            scarleton
                            wrote on last edited by
                            #13

                            [quote author="Tobias Hunger" date="1292707921"]Scarleton, VCsala: Any ideas for a better place to put those settings? I thought the place they are now is rather obvious...[/quote]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

                            1 Reply Last reply
                            0
                            • G Offline
                              G Offline
                              giesbert
                              wrote on last edited by
                              #14

                              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.

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

                              1 Reply Last reply
                              0
                              • T Offline
                                T Offline
                                tobias.hunger
                                wrote on last edited by
                                #15

                                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":http://bugreports.qt.nokia.com/ so it won't be forgotten?

                                1 Reply Last reply
                                0
                                • V Offline
                                  V Offline
                                  vcsala
                                  wrote on last edited by
                                  #16

                                  [quote author="Gerolf Reinwardt" date="1292747656"]Personally, I like context menus and options there and it could help to have an additional entry forwarding to the projects page, yes.[/quote]

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

                                  1 Reply Last reply
                                  0
                                  • G Offline
                                    G Offline
                                    goetz
                                    wrote on last edited by
                                    #17

                                    +1 for a menu entry "Go to project settings" which does switch to the project view of creator and switches there to the currently selected project.

                                    http://www.catb.org/~esr/faqs/smart-questions.html

                                    1 Reply Last reply
                                    0
                                    • T Offline
                                      T Offline
                                      tobias.hunger
                                      wrote on last edited by
                                      #18

                                      Create an entry in the bug tracker and vote for it instead of going "+1" here...

                                      1 Reply Last reply
                                      0
                                      • V Offline
                                        V Offline
                                        vsorokin
                                        wrote on last edited by
                                        #19

                                        Tobias Hunger, I do it. Link: http://bugreports.qt.nokia.com/browse/QTCREATORBUG-3419

                                        --
                                        Vasiliy

                                        1 Reply Last reply
                                        0
                                        • G Offline
                                          G Offline
                                          giesbert
                                          wrote on last edited by
                                          #20

                                          ok, voted for it.

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

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved