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. How to setup Qt for MSVC2010 after successfull build (correct path moc.exe) (Change Qt-Path)
Forum Updated to NodeBB v4.3 + New Features

How to setup Qt for MSVC2010 after successfull build (correct path moc.exe) (Change Qt-Path)

Scheduled Pinned Locked Moved General and Desktop
21 Posts 4 Posters 12.1k 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.
  • jensen82J Offline
    jensen82J Offline
    jensen82
    wrote on last edited by
    #1

    Hi!

    I build Qt with MSVC2010 on another machine in the directory C:\Qt\473. I copied the files and directories to my home computer to D:\Qt\473. The path to moc.exe i incorrect now if try to build an example. Visual Studio can't find moc.exe. Is there a way to correct with rebuilding Qt?

    Thank you!

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      there are some guidlines in "FAQ":http://developer.qt.nokia.com/faq/answer/is_it_possible_to_move_the_qt_directory_to_another_directory_after_installa

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

      1 Reply Last reply
      0
      • T Offline
        T Offline
        thisisbhaskar
        wrote on last edited by
        #3

        And one more thing, in your title its not QT ( QuickTime), its Qt.

        1 Reply Last reply
        0
        • jensen82J Offline
          jensen82J Offline
          jensen82
          wrote on last edited by
          #4

          Hey! Thanks for replying.

          My description is a bit buggy. The problem ist that MSBuild shows the error. It can't find moc.exe. I think qPatch is not the thing i need here (does not patch binaries, right?)...i will try qt.conf.
          Where to put the qt.conf? In the main Qt-Directory?

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            That is a really good question. I could not find it in the text.

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

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on last edited by
              #6

              "Here":http://doc.qt.nokia.com/latest/qt-conf.html are directories given, but not for windows.
              I would check with the Qt dir. Possibly there is the ...\mkspecs\win32-msvc2010 as another possibility, but I do not know how those are used for compilation.
              BTW: Did you install "vsaddin":http://developer.qt.nokia.com/wiki/QtVSAddin on the other computer?

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

              1 Reply Last reply
              0
              • jensen82J Offline
                jensen82J Offline
                jensen82
                wrote on last edited by
                #7

                Hi! I cleaned it by uninstalling/reinstall the Qt-Addin for VS. If i create a new project it works. The examples delivered with Qt cannot be build. But that's a Visual Studio-Thing. If i open the .vcxproj file cretaed by nmake there's the wrong path. It's the custom build tool.

                So i tried to change it in Visual Studio's project properties...but i can't find it.

                Maybe this is what qPatch is for... search for old directory and replace it with your new one.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #8

                  I have no experience in that direction. Just remembered that there was a post providing the information for a patch. I did in the past do always a new compilation.

                  It could be that you have to put the qt.conf to the directory where vsaddin resides.

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

                  1 Reply Last reply
                  0
                  • jensen82J Offline
                    jensen82J Offline
                    jensen82
                    wrote on last edited by
                    #9

                    Tried it...no luck! I searched with AgentRansack in the Qt-Directory for the path...it's in almost every file...

                    I hope this thread can be solved...or i'm the first one with this kind or problem?

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      koahnig
                      wrote on last edited by
                      #10

                      Did you have a look to the source of qpatch ?
                      Respectively, did you try to use?

                      As it looks it simply does read all the files in question, supplied in a file list. Every occurance of the old dir path will be replaced with the new dir. This seems to be fairly simple. However, I will not recommend doing without that tool. But it might be worth a try.

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

                      1 Reply Last reply
                      0
                      • jensen82J Offline
                        jensen82J Offline
                        jensen82
                        wrote on last edited by
                        #11

                        I tried it. At first i will modify the src. So that it pathes all files. It makes no sense to pass every file in the qt-dir to the command-line. I'll modify it so that it patches each file. Or could you tell me with files i have to patch? This is a real trivial thing and Qt makes to much work out of it...

                        1 Reply Last reply
                        0
                        • K Offline
                          K Offline
                          koahnig
                          wrote on last edited by
                          #12

                          If you go to the "repository":http://qt.gitorious.org/qt-creator/qt-creator/trees/master/src/tools/qpatch there is the short cpp-file and also the lists of files to change.

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

                          1 Reply Last reply
                          0
                          • jensen82J Offline
                            jensen82J Offline
                            jensen82
                            wrote on last edited by
                            #13

                            Yes. Thank you!

                            But one problem resists: The path to Qt in the files is different from file to file.

                            Example1: C:/Qt/
                            Example2: c:\Qt
                            Example3: C:/qt

                            It's necessary to run qPatch more than one time to patch all files.

                            1 Reply Last reply
                            0
                            • K Offline
                              K Offline
                              koahnig
                              wrote on last edited by
                              #14

                              Glad to see that you were succeeding.

                              What is the OS you have?

                              I was trying it myself after the last post. However, the it was not as easy to handle as it looked in the beginning. I have Win7 64 bit. All security measures were activated. I could not debug nor run it easily from a command prompt. I am wondering about the best way around such issues. It is not helpful when you cannot read the output messages on screen.

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

                              1 Reply Last reply
                              0
                              • jensen82J Offline
                                jensen82J Offline
                                jensen82
                                wrote on last edited by
                                #15

                                " I could not debug nor run it easily from a command prompt " ... you can't run qPatch?

                                I think we should correct qPatch to make it a bit more comfortable. Why can we install Qt with mingw without these problems or Qtmsvc2008 without these problems...and after building with msvc2010....problems.

                                1 Reply Last reply
                                0
                                • K Offline
                                  K Offline
                                  koahnig
                                  wrote on last edited by
                                  #16

                                  I can run, but it is not as you are used to. However, this is not a Qt problem.

                                  In case you are not aware of this. On Win7 ( and Vista) you have to confirm the actions of any program trying to search the disk or writing to the areas where programs are installed. When you start such a program a window pops up asking for confirmation. Unfortunately, the functionality is not returned to the command window you started off, but it is continued in a new command window. The window pops up and it is closed when the program finished. Unfortunately the output is gone with closing of the window. :-( Simple piping did not work, so I had to change qpatch to write to disk. So this becomes quite ackward when you are trying to find the proper spelling of the dir names as you lined out above.

                                  The debugging is probably not running because of Win7 again. The same security measure signals a nogo to the debugger.
                                  BTW it could be also an additional feature of the virus scanner.

                                  Probably one can switch off all these security features, but on the other side I prefer to see, when someone else is going to do things on my machine.

                                  I guess most of the problems are existing because more open source ethusiasts are on linux. Would be interesting to see a statistic about that.

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

                                  1 Reply Last reply
                                  0
                                  • T Offline
                                    T Offline
                                    textral
                                    wrote on last edited by
                                    #17

                                    The link you referred to was broken. Can you find it again and post the new location? I'm trying to find the list of files that needs to be patched. Thanks

                                    [quote author="koahnig" date="1309794847"]If you go to the "repository":http://qt.gitorious.org/qt-creator/qt-creator/trees/master/src/tools/qpatch there is the short cpp-file and also the lists of files to change. [/quote]

                                    1 Reply Last reply
                                    0
                                    • K Offline
                                      K Offline
                                      koahnig
                                      wrote on last edited by
                                      #18

                                      [quote author="textral" date="1324554733"]The link you referred to was broken. Can you find it again and post the new location? I'm trying to find the list of files that needs to be patched. Thanks
                                      [/quote]

                                      here is a link again.
                                      "qPatch":http://qt.gitorious.org/qt-creator/qt-creator/trees/9e972b068d5beef0cc5041f7397efd2ff5ad7570/src/tools/qpatch
                                      However this is not a solid way to reference it. It seems to be part of a clone, which google spilled out. The link may be broken again soon. Furthermore, the status is completely unclear. Unfortunately, I could not find that section in the official source tree of creator anymore.

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

                                      1 Reply Last reply
                                      0
                                      • K Offline
                                        K Offline
                                        koahnig
                                        wrote on last edited by
                                        #19

                                        Here is a "link":http://db.tt/30Lx4Gz7 to the source found on my drive. The source has been adapted for debug output to a file. I doubt that there are other changes. However, one has to check anyhow.

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

                                        1 Reply Last reply
                                        0
                                        • T Offline
                                          T Offline
                                          textral
                                          wrote on last edited by
                                          #20

                                          Fantastic koahnig, thanks.

                                          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