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. Problem in debugging qt program
Forum Updated to NodeBB v4.3 + New Features

Problem in debugging qt program

Scheduled Pinned Locked Moved General and Desktop
28 Posts 3 Posters 8.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.
  • A Offline
    A Offline
    Amirhosein
    wrote on 9 Aug 2013, 14:42 last edited by
    #1

    Hey everybody

    I am new in Qt and I've just written my 'hello world' program. But in the first step I have a problem with compiling my program.
    first I write:
    qmake -project
    qmake hello.pro
    and then:
    nmake
    but when I run nmake it gives me this error :
    "...
    NMAKE : fatal error U1077: "C:\Program Files\Microsoft Visual Studio 9,0\VC\bin\namek.exe"' : return code '0x2'
    Stop."

    any suggestion for solving the problem?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 9 Aug 2013, 15:04 last edited by
      #2

      Hi and welcome to devnet,

      You have to provide the lines before that one to see where the error actually happened

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Amirhosein
        wrote on 9 Aug 2013, 15:36 last edited by
        #3

        thanks
        this the whole error:

        Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
        Copyright (C) Microsoft Corporation. All rights reserved.

            "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\nmake.exe" -f Makef
        

        ile.Debug

        Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
        Copyright (C) Microsoft Corporation. All rights reserved.

            cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189
        

        -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -D
        QT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_T
        HREAD_SUPPORT -I"c:\Qt\4.8.4-VS2010\include\QtCore" -I"c:\Qt\4.8.4-VS2010\includ
        e\QtGui" -I"c:\Qt\4.8.4-VS2010\include" -I"." -I"c:\Qt\4.8.4-VS2010\include\Acti
        veQt" -I"debug" -I"c:\Qt\4.8.4-VS2010\mkspecs\default" -Fodebug\ @C:\Users\SMOTA
        M~1\AppData\Local\Temp\nm2C9F.tmp
        NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin
        \cl.EXE"' : return code '0xc0000135'
        Stop.
        NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin
        \nmake.exe"' : return code '0x2'
        Stop.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 9 Aug 2013, 15:39 last edited by
          #4

          Do you have VisualStudio 2008 installed ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Amirhosein
            wrote on 9 Aug 2013, 18:21 last edited by
            #5

            of course I have.

            Something may be useful for solving the problem. I added "c:\program files\microsoft visual studio 9.0\VC\bin" to the Paths. maybe I should add something more.

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on 9 Aug 2013, 18:46 last edited by
              #6

              where do you run nmake?
              Outside of the msvc using a simple command prompt?

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

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Amirhosein
                wrote on 9 Aug 2013, 19:14 last edited by
                #7

                yes
                I use simple command prompt and not VS command prompt

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 9 Aug 2013, 19:47 last edited by
                  #8

                  I might be wrong, but I think that using a MSVC2010 Qt with VS2008 might be problematic

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    koahnig
                    wrote on 9 Aug 2013, 19:51 last edited by
                    #9

                    This is probably the reason for your problem.
                    When you are compiling Qt libs with nmake and msvc compiler you have to start the command prompt through VS. It will not work with the standard command prompt. VS is setting apparently something in the environment.

                    I have never tried, but I would guess that the same rules apply when use nmake directly. Give it a try.
                    AFAIK there is no way around the VS command prompt.

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

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      koahnig
                      wrote on 9 Aug 2013, 19:52 last edited by
                      #10

                      [quote author="SGaist" date="1376077649"]I might be wrong, but I think that using a MSVC2010 Qt with VS2008 might be problematic[/quote]
                      That is for sure too. You cannot mix different msvc versions.

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

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 9 Aug 2013, 20:01 last edited by
                        #11

                        [quote author="koahnig" date="1376077876"]
                        I have never tried, but I would guess that the same rules apply when use nmake directly. Give it a try.
                        AFAIK there is no way around the VS command prompt. [/quote]

                        You can if you setup the environment by hand, it can even work from an msys prompt (i.e. installed with git for windows) but that's not for the faint hearted.

                        IIRC, there are several batch files you can use to setup a command prompt. They can be found in the VS install, or the quick way is to check the properties of the various command prompt shortcut in the Start menu

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • K Offline
                          K Offline
                          koahnig
                          wrote on 9 Aug 2013, 21:01 last edited by
                          #12

                          [quote author="SGaist" date="1376078503"]
                          [quote author="koahnig" date="1376077876"]
                          I have never tried, but I would guess that the same rules apply when use nmake directly. Give it a try.
                          AFAIK there is no way around the VS command prompt. [/quote]

                          You can if you setup the environment by hand, it can even work from an msys prompt (i.e. installed with git for windows) but that's not for the faint hearted.

                          IIRC, there are several batch files you can use to setup a command prompt. They can be found in the VS install, or the quick way is to check the properties of the various command prompt shortcut in the Start menu[/quote]

                          Well, I was never digging as deep. I was doing a couple of compilations of Qt 4 versions. All I know is that one had to use msvc command prompt. That was the officially recommended way to do the compilation based on msvc for quite some time. However, that might have changed over the time.

                          However, the problem or an additional problem is probably the mix of different msvc versions. The libs of msvc were always dependent of the compiler versions.

                          Since msvc2008 is used and no pre-build of msvc2008 is on the official page, that is for sure the next thing to check.

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

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 9 Aug 2013, 21:05 last edited by
                            #13

                            [quote author="koahnig" date="1376082086"]
                            Well, I was never digging as deep. I was doing a couple of compilations of Qt 4 versions. All I know is that one had to use msvc command prompt. That was the officially recommended way to do the compilation based on msvc for quite some time. However, that might have changed over the time. [/quote]

                            IFAIK, it hasn't changed a bit, I did that to automate release builds and I like bash better.

                            [quote author="koahnig" date="1376082086"]
                            However, the problem or an additional problem is probably the mix of different msvc versions. The libs of msvc were always dependent of the compiler versions.

                            Since msvc2008 is used and no pre-build of msvc2008 is on the official page, that is for sure the next thing to check. [/quote]

                            Completely agree

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • A Offline
                              A Offline
                              Amirhosein
                              wrote on 9 Aug 2013, 22:14 last edited by
                              #14

                              Thank you very much for your help

                              I will try to solve the problem with your solution on Monday at work and then if I still have this problem, we can try to find another solution.

                              As your information, I tried the later versions of visual studio but the result was same. I prefer to use MSVC 2008 because it is in English and others are in german. anyway, thanks again for your help.

                              1 Reply Last reply
                              0
                              • K Offline
                                K Offline
                                koahnig
                                wrote on 10 Aug 2013, 08:41 last edited by
                                #15

                                [quote author="Amirhosein" date="1376086468"]Thank you very much for your help

                                I will try to solve the problem with your solution on Monday at work and then if I still have this problem, we can try to find another solution.

                                As your information, I tried the later versions of visual studio but the result was same. I prefer to use MSVC 2008 because it is in English and others are in german. anyway, thanks again for your help.[/quote]

                                The open question at the time is whether you have installed the correct Qt lib version. The version has to be compiled with the same MSVC version as you are trying to do your application.

                                Which version of Qt are you using?
                                Is it Qt5 or Qt4?
                                Where did you download from?

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

                                1 Reply Last reply
                                0
                                • A Offline
                                  A Offline
                                  Amirhosein
                                  wrote on 12 Aug 2013, 13:15 last edited by
                                  #16

                                  I use Qt v4,8,4 (VS2010 Opensource). I don't know from where it is downloaded.

                                  when I call nmake in command prompt, it gives me same fatal error for both of MSVC that I have. Maybe my MSVCs have a problem.

                                  These are the errors:

                                  C:\Program Files\Microsoft Visual Studio 9.0\VC>nmake

                                  Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
                                  Copyright (C) Microsoft Corporation. All rights reserved.

                                  NMAKE : fatal error U1064: MAKEFILE not found and no target specified
                                  Stop.

                                  C:\Program Files\Microsoft Visual Studio 10.0\VC>nmake

                                  Microsoft (R) Program Maintenance Utility, Version 10.00.30319.01
                                  Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

                                  NMAKE : fatal error U1064: MAKEFILE nicht gefunden und kein Ziel angegeben
                                  Stop.

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on 12 Aug 2013, 13:35 last edited by
                                    #17

                                    You have both Visual Studio 2008 and 2010 installed ?

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    0
                                    • A Offline
                                      A Offline
                                      Amirhosein
                                      wrote on 12 Aug 2013, 13:38 last edited by
                                      #18

                                      yes I have the both.

                                      1 Reply Last reply
                                      0
                                      • K Offline
                                        K Offline
                                        koahnig
                                        wrote on 12 Aug 2013, 13:39 last edited by
                                        #19

                                        If you want to use Qt libs 4.8.4 (VS2010 Opensource) you must use the compiler tool chain shipped with msvc2010 for compilation.

                                        "According to this":http://de.wikipedia.org/wiki/Microsoft_Visual_Studio#Version_2010 it would be the second one you have tried.
                                        [quote author="Amirhosein" date="1376313350"]
                                        C:\Program Files\Microsoft Visual Studio 10.0\VC>nmake

                                        Microsoft (R) Program Maintenance Utility, Version 10.00.30319.01
                                        Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

                                        NMAKE : fatal error U1064: MAKEFILE nicht gefunden und kein Ziel angegeben
                                        Stop.
                                        [/quote]
                                        This seems to be correct nmake, but the makefile is missing.

                                        Do you use msvc2010 as IDE (integrated development environment) or Qt creator?

                                        I got the feeling that you are working on command prompt only. Is that true?

                                        Anyway a qmake run is missing. This would create the missing makefile.

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

                                        1 Reply Last reply
                                        0
                                        • A Offline
                                          A Offline
                                          Amirhosein
                                          wrote on 12 Aug 2013, 13:43 last edited by
                                          #20

                                          I don't have Qt creator, so I only use command prompt.

                                          so you think that my Qt has a problem?

                                          1 Reply Last reply
                                          0

                                          1/28

                                          9 Aug 2013, 14:42

                                          • Login

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