Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Problem importing .pro file into Visual Studio
Forum Update on Monday, May 27th 2025

Problem importing .pro file into Visual Studio

Scheduled Pinned Locked Moved Qt Creator and other tools
9 Posts 2 Posters 13.4k Views
  • 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.
  • J Offline
    J Offline
    JohnDoes
    wrote on 28 Aug 2012, 14:42 last edited by
    #1

    Hi,
    I have installed the qt visual studio plugin, but when I try to open an existing .pro file over the Qt menu, I get the following error:
    @-- (qmake) : Arguments: -tp vc "dataTree.pro" -o "dataTree.vcxproj" QMAKE_INCDIR_QT=$(QTDIR)\include QMAKE_LIBDIR=$(QTDIR)\lib QMAKE_MOC=$(QTDIR)\bin\moc.exe QMAKE_QMAKE=$(QTDIR)\bin\qmake.exe

    [1] - WARNING: (internal):1: Unescaped backslashes are deprecated.
    [2] - WARNING: (internal):1: Unescaped backslashes are deprecated.
    [3] - WARNING: (internal):1: Unescaped backslashes are deprecated.

    --- (Import): Error(s): 3
    --- (qmake) : Exit Code: 0

    --- (Import): Generated project could not be loaded.
    --- (Import): Please look in the output above for errors and warnings.@

    I think the problem is the backslashes within the qmake arguments, but how can I change them to normal slashes in Visual Studio?

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on 28 Aug 2012, 15:59 last edited by
      #2

      welcome to devnet

      With Visual Studio you should be able to change the backslashes with replace (ctrl+h). You need to use regular expressions. In the string to change you need to use "\" (double backslashes).

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JohnDoes
        wrote on 29 Aug 2012, 07:11 last edited by
        #3

        Hi, thank you very much for your welcome :)
        Unfortunately, your method does not work on my problem.
        What I am doing is going to the menu item "Qt"->"Open Qt project (.pro) file", then chose the file and all other is executed automatically. So, there is no way to change the backslashes here.
        How can I change the instruction, that the Qt creator executes?

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on 29 Aug 2012, 07:21 last edited by
          #4

          I am not aware of a possibility to change a setting for import. However, why you are not opening the .pro file simply with vc as editor. Than you can change the backslashes to forward slashes. Save it and open again through the Qt menu. Beware of the continuation lines. Those require the backslashes at the end of the previous lines.

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • J Offline
            J Offline
            JohnDoes
            wrote on 29 Aug 2012, 08:35 last edited by
            #5

            But the problem is not in my .pro file, it does not matter what I write within the file. Even when I open an empty .pro file the backslash problem appears. So, there must be a problem with the importer :/

            What I have done now is, I have used to command line tool to build the .vcxproj file (visual studio project file) manually. Unfortunately, when I double click the visual studio project file, it says that the project file could not be read and I should open it with the visual studio IDE to convert it to the last version, before it can be build by the MSBuild. But how can I convert the project file?? When I chose -> File-> Open->convert , there is no converter available.

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on 29 Aug 2012, 09:00 last edited by
              #6

              Apparently you are using msvc 2010 or newer. No experience with that tool. Still using vc2005.

              I would assume that your command line may have generated for an older version. within the first lines you should see something like
              @<VisualStudioProject
              ProjectType="Visual C++"
              Version="8.00"
              @
              Which version is stated in your case?
              You may have to name the file to .vcproj and open with visual studio, but that is a wild guess.

              [quote author="JohnDoes" date="1346224301"]
              How can I change the instruction, that the Qt creator executes?[/quote]

              What do you mean with that?
              Are you trying to use Qt creator or visual studio?
              qmake is used with both.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              0
              • J Offline
                J Offline
                JohnDoes
                wrote on 29 Aug 2012, 09:40 last edited by
                #7

                Ok, i have managed to open the import dialog by changing the version from 8.00 to 9.00 and changing the file to .vcproj - thanks for that :)
                Now the project imports, but the Qt libraries can not be found (e.g. #include <QtGui/QApplication>).
                When I create a new Qt project with visual studio, there is no problem with Qt libraries.


                Regarding your second question:
                Sorry, i mean the Qt plugin for visual studio and not Qt creator, I am using visual studio.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  koahnig
                  wrote on 29 Aug 2012, 10:05 last edited by
                  #8

                  Try if you can go to "Qt project settings" and there to "Qt modules". You might be able to select the modules you need.
                  AFAIK I had problems in the past. In the mean time it is my custom to make my new projects Qt projects in general, even if I am not intending to use Qt in the beginning. I believe I am doing this also because of trouble when trying to add Qt later on.

                  However, this is for sure a couple of versions of vsaddin back.

                  Vote the answer(s) that helped you to solve your issue(s)

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    JohnDoes
                    wrote on 29 Aug 2012, 12:00 last edited by
                    #9

                    Ok, the errors are gone.
                    Thank you so much for your help!!!!! :)

                    1 Reply Last reply
                    0

                    1/9

                    28 Aug 2012, 14:42

                    • Login

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