April 21, 2011

muntoo muntoo
Lab Rat
7 posts

Visual Studio 2010 nmake error

Page  
1

I downloaded qt-everywhere-opensource-src-4.7.2.zip; then I extracted it to C:\Qt.

I used the MSVS Command Prompt (2010), and typed in:

  1. cd /D C:\Qt
  2.  
  3. configure -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-ltcg

That worked OK, so then I did this:

  1. nmake

After a little while, I got the following error:

  1.         mt.exe -nologo -manifest "tmp\obj\release_shared\QtCore.intermediate.man
  2. ifest" -outputresource:..\..\lib\QtCore4.dll;2
  3. NMAKE : fatal error U1077: '"C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\m
  4. t.exe"' : return code '0x1f'
  5. Stop.
  6. NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BI
  7. N\nmake.exe"' : return code '0x2'
  8. Stop.
  9. NMAKE : fatal error U1077: 'cd' : return code '0x2'
  10. Stop.
  11.  
  12. C:\Qt>

My specs are: Vista Home Premium 32-bit, and I’m using Microsoft Visual Studio 2010 Pro (via DreamSpark).

Any ideas on how I can resolve this?

17 replies

April 27, 2011

leon.anavi leon.anavi
Mad Scientist
699 posts

muntoo wrote:

  1. cd /D C:\Qt
  2.  
  3. configure -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-ltcg

You might need to specify the platform when using the configure command.

Best regards,
Leon

 Signature 

http://anavi.org/

April 27, 2011

Alexander Kuchumov Alexander Kuchumov
Hobby Entomologist
377 posts

leon.anavi wrote:

You might need to specify the platform when using the configure command.

MSVS Command Prompt (2010) holds QMAKESPEC.
The platform gets value from QMAKESPEC.
It isn’t required.

April 27, 2011

leon.anavi leon.anavi
Mad Scientist
699 posts
Alexander Kuchumov wrote:
leon.anavi wrote:
You might need to specify the platform when using the configure command.
MSVS Command Prompt (2010) holds QMAKESPEC. The platform gets value from QMAKESPEC. It isn’t required.

OK, sorry my proposition was just a guess.

 Signature 

http://anavi.org/

May 2, 2011

agent8261 agent8261
Lab Rat
5 posts

I too had problems trying to install Qt 4.7.2 and integrating it with visual studio. When I tried to compile Qt using nmake I always got an error stating that some dll was in use. The actual dll changed every time. After about 2 days of searching and trying things, I fixed it, but I’m not at all sure what was wrong.

Hopefully this will help. Here are the exact steps I had to do in order to compile:

1: I uninstalled all the QT binaries.

2: I deleted the Qt folder.

3: I downloaded the Visual Studio Add-in [qt.nokia.com]

4: I installed the visual studio add-in

5: I downloaded the Qt source code [get.qt.nokia.com]

6: I created New folders c:\Qt\4.7.2-vc\ and extracted the source code to it.

7: I set the environment variables:

QTDIR = C:\Qt\4.7.2-vc\

QMAKESPEC = win32-msvc2010

8: I added to the Path variable:

cd C:\Qt\4.7.2-vc\bin

!!Check!!
If you set it up like I did, then you should be able to do:

C:\Qt\4.7.2-vc\configure.exe -help

from the windows cmd prompt.

9: I downloaded the lasts version of “jom”: ftp://ftp.qt.nokia.com/jom/

10: I created the folder C:\Qt\4.7.2-vc\jom extracted the jom files to it

11: I restarted windows then opened the VISUAL STUDIO command prompt and ran

C:
cd C:\Qt\4.7.2-vc
configure -debug-and-release -opensource -platform win32-msvc2010

The configuration took awhile. After it was finished

12: I RESTARTED IN SAFE MODE!!!!

I don’t know why this step was important, but I had to do the actual compilation in safe mode.

13: Open the VISUAL STUDIO command prompt and run

C:
cd C:\Qt\4.7.2-vc
C:\Qt\4.7.2-vc\jom\jom.exe –j 8

8 is the number of CPU cores for my computer.

Building the file took a long time. By far the longest I have ever seen, but if finally finished.

Afterwards I had to open visual studio and configure the add-in. Below are the sites that helped me figure everything out.

http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/

http://stackoverflow.com/questions/4379374/compiling-qt-visual-studio-2010

http://blog.paulnettleship.com/2010/11/11/troubleshooting-visual-studio-2010-and-qt-4-7-integration/

http://dcsoft.wordpress.com/

FYI: I’m on windows 7, using visual studio 2010 ultimate (version 10.0.30319.1), running on a Intel i7(q720). I compiled 4.72 LGPL version of the QT framework. I am using the Visual Studio Qt add-in 1.1.9-1.

May 4, 2011

muntoo muntoo
Lab Rat
7 posts

I’ve installed the Visual Studio 2010 Add-in. I’m still not sure whether I have to compile the source code, or if any of the installers will work with Visual Studio 2010.

May 4, 2011

agent8261 agent8261
Lab Rat
5 posts

I’m not sure if you “have” to compile it yourself or not, but I did. I remember reading somewhere during my search to fix the problem, that the qt binaries are for an older version of visual studio. Long story short, I assumed that I had to compile from source.

Step 13 is where I compiled the src code.

C:\Qt\4.7.2-vc\jom\jom.exe –j 8

is what starts the compile process.

May 4, 2011

agent8261 agent8261
Lab Rat
5 posts

Note, I never used nmake.

May 4, 2011

muntoo muntoo
Lab Rat
7 posts

Hmmm… Is Qt pure C++, or does it require any compilers for other languages?

  1. Error: Creating a shadow build of Qt requires
  2. perl to be in the PATH environment

(I’ll probably be able to work around this, but I’m just saying that it said that.)

May 4, 2011

agent8261 agent8261
Lab Rat
5 posts

That error means that you have qt installed (more precisely configured) already.

There is some command to undo a previous configuration. I don’t remember what it was. You could also install perl, but I think undoing the previous configuration is easier.

I think Qt uses perl for scripting. From what I understand, Qt uses a bunch of macros and meta commands to “extend” c++. Qmake then changes your code to actual c++ for compiling. But I’m just learning how to use Qt so, that’s just my guess.

May 5, 2011

muntoo muntoo
Lab Rat
7 posts

When I ran:

  1. configure -debug-and-release -opensource -platform win32-msvc2010

It ran for a while. Then, I got:

  1. header created for C:/Qt/4.7.2-vc/src/qt3support/widgets/q3widgetstack.h (2)
  2. header (master) created for Qt3Support
  3. headers.pri file created for Qt3Support
  4. mkdir C:/Qt/4.7.2-vc/bin/src/tools
  5. mkdir C:/Qt/4.7.2-vc/bin/src/tools/uic
  6. Creating qmake...
  7.  
  8. Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
  9. Copyright (C) Microsoft Corporation.  All rights reserved.
  10.  
  11. Creating makefiles in src...
  12. Generating Visual Studio project files...
  13. execute: File or path is not found (C:\Qt\4.7.2-vc\bin\bin\qmake)
  14. Qmake failed, return code -1
  15.  
  16. Generating Makefiles...
  17. execute: File or path is not found (C:\Qt\4.7.2-vc\bin\bin\qmake)
  18. Qmake failed, return code -1
  19.  
  20.  
  21. C:\Qt\4.7.2-vc\bin>

May 7, 2011

agent8261 agent8261
Lab Rat
5 posts

Looks like some file path variable isn’t set correctly. Check your environment variables.

May 15, 2011

muntoo muntoo
Lab Rat
7 posts

OK, here it is this time:

  1. Setting environment for using Microsoft Visual Studio 2010 x86 tools.
  2.  
  3. C:Program FilesMicrosoft Visual Studio 10.0VC>cd %QTDIR%
  4.  
  5. C:Qt4.7.2-vc>configure -debug-and-release -opensource -platform win32-msvc2010
  6.  
  7.  
  8. This is the Qt for Windows Open Source Edition.
  9.  
  10. You are licensed to use this software under the terms of
  11. the GNU Lesser General Public License (LGPL) version 2.1
  12. or the GNU General Public License (GPL) version 3.
  13.  
  14. Type '3' to view the GNU General Public License version 3 (GPLv3).
  15. Type 'L' to view the Lesser GNU General Public License version 2.1 (LGPLv2.1).
  16. Type 'y' to accept this license offer.
  17. Type 'n' to decline this license offer.
  18.  
  19. Do you accept the terms of the license?
  20. y
  21. Environment:
  22.     INCLUDE=
  23.       C:Program FilesMicrosoft Visual Studio 10.0VCINCLUDE
  24.       C:Program FilesMicrosoft Visual Studio 10.0VCATLMFCINCLUDE
  25.       C:Program FilesMicrosoft SDKsWindowsv7.0Ainclude
  26.  
  27.     LIB=
  28.       C:Program FilesMicrosoft Visual Studio 10.0VCLIB
  29.       C:Program FilesMicrosoft Visual Studio 10.0VCATLMFCLIB
  30.       C:Program FilesMicrosoft SDKsWindowsv7.0Alib
  31.  
  32.     PATH=
  33.       C:Program FilesMicrosoft F#v4.0
  34.       C:Program FilesMicrosoft Visual Studio 10.0VSTSDBDeploy
  35.       C:Program FilesMicrosoft Visual Studio 10.0Common7IDE
  36.       C:Program FilesMicrosoft Visual Studio 10.0VCBIN
  37.       C:Program FilesMicrosoft Visual Studio 10.0Common7Tools
  38.       c:WindowsMicrosoft.NETFrameworkv4.0.30319
  39.       c:WindowsMicrosoft.NETFrameworkv3.5
  40.       C:Program FilesMicrosoft Visual Studio 10.0VCVCPackages
  41.       C:Program FilesHTML Help Workshop
  42.       C:Program FilesMicrosoft SDKsWindowsv7.0AbinNETFX 4.0 Tools
  43.       C:Program FilesMicrosoft SDKsWindowsv7.0Abin
  44.       C:Perlsitebin
  45.       C:Perlbin
  46.       C:Program FilesCommon FilesMicrosoft SharedWindows Live
  47.       C:Windowssystem32
  48.       C:Windows
  49.       C:WindowsSystem32Wbem
  50.       C:Program FilesZipGenius 6
  51.       c:Program FilesMicrosoft SQL Server100ToolsBinn
  52.       c:Program FilesMicrosoft SQL Server100DTSBinn
  53.       C:PROGRA~1TIEDUC~1TI-83P~1UTILS
  54.       C:WindowsSystem32WindowsPowerShellv1.0
  55.       C:Program FilesWindows LiveShared
  56.       C:Program FilesCalibre2
  57.       C:Program FilesTortoiseHg
  58.       C:Program FilesTortoiseSVNbin
  59.       C:Program FilesQuickTimeQTSystem
  60.       C:Qt4.7.2-vc
  61.       C:Qt4.7.2-vcbin
  62.       C:Program FilesMercurial
  63. You are licensed to use this software under the terms of the GNU GPL version 3.Y
  64. ou are licensed to use this software under the terms of the Lesser GNU LGPL vers
  65. ion 2.1.
  66. See C:/Qt/4.7.2-vc3
  67.  
  68.  or C:/Qt/4.7.2-vcL
  69.  
  70. Configuration:
  71.     minimal-config
  72.     small-config
  73.     medium-config
  74.     large-config
  75.     full-config
  76.     build_all
  77.     debug
  78. Qt Configuration:
  79.     release
  80.     debug
  81.     zlib
  82.     png
  83.     accessibility
  84.     opengl
  85.     s60
  86.     ipv6
  87.     script
  88.     scripttools
  89.     xmlpatterns
  90.     phonon
  91.     phonon-backend
  92.     multimedia
  93.     audio-backend
  94.     declarative
  95.     native-gestures
  96.     svg
  97.     minimal-config
  98.     small-config
  99.     medium-config
  100.     large-config
  101.     full-config
  102.  
  103. QMAKESPEC...................win32-msvc2010 (commandline)
  104. Architecture................windows
  105. Maketool....................nmake
  106. Debug symbols...............yes
  107. Link Time Code Generation...no
  108. Accessibility support.......yes
  109. STL support.................yes
  110. Exception support...........yes
  111. RTTI support................yes
  112. MMX support.................yes
  113. 3DNOW support...............yes
  114. SSE support.................yes
  115. SSE2 support................yes
  116. IWMMXT support..............no
  117. OpenGL support..............yes
  118. OpenVG support..............no
  119. OpenSSL support.............no
  120. QtDBus support..............no
  121. QtXmlPatterns support.......yes
  122. Phonon support..............yes
  123. QtMultimedia support........yes
  124. WebKit support..............yes
  125. Declarative support.........yes
  126. Declarative debugging.......yes
  127. QtScript support............yes
  128. QtScriptTools support.......yes
  129. Graphics System.............raster
  130. Qt3 compatibility...........yes
  131.  
  132. Third Party Libraries:
  133.     ZLIB support............qt
  134.     GIF support.............plugin
  135.     TIFF support............plugin
  136.     JPEG support............plugin
  137.     PNG support.............yes
  138.     MNG support.............plugin
  139.     FreeType support........no
  140.  
  141. Styles:
  142.     Windows.................yes
  143.     Windows XP..............yes
  144.     Windows Vista...........yes
  145.     Plastique...............yes
  146.     Cleanlooks..............yes
  147.     Motif...................yes
  148.     CDE.....................yes
  149.     Windows CE..............no
  150.     Windows Mobile..........no
  151.     S60.....................no
  152.  
  153. Sql Drivers:
  154.     ODBC....................no
  155.     MySQL...................no
  156.     OCI.....................no
  157.     PostgreSQL..............no
  158.     TDS.....................no
  159.     DB2.....................no
  160.     SQLite..................plugin (qt)
  161.     SQLite2.................no
  162.     InterBase...............no
  163.  
  164. Sources are in..............C:Qt4.7.2-vc
  165. Build is done in............C:Qt4.7.2-vc
  166. Install prefix..............C:Qt4.7.2-vc
  167. Headers installed to........C:Qt4.7.2-vcinclude
  168. Libraries installed to......C:Qt4.7.2-vclib
  169. Plugins installed to........C:Qt4.7.2-vcplugins
  170. Imports installed to........C:Qt4.7.2-vcimports
  171. Binaries installed to.......C:Qt4.7.2-vcbin
  172. Docs installed to...........C:Qt4.7.2-vcdoc
  173. Data installed to...........C:Qt4.7.2-vc
  174. Translations installed to...C:Qt4.7.2-vctranslations
  175. Examples installed to.......C:Qt4.7.2-vcexamples
  176. Demos installed to..........C:Qt4.7.2-vcdemos
  177.  
  178. Running syncqt...
  179. Creating qmake...
  180.  
  181. Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
  182. Copyright (C) Microsoft Corporation.  All rights reserved.
  183.  
  184. Creating makefiles in src...
  185. Generating Visual Studio project files...
  186. execute: Unknown error
  187.    (-nodepend)
  188.    (-tp)
  189.    (vc)
  190.    (-r)
  191.    (C:/Qt/4.7.2-vc/projects.pro)
  192.    (-o)
  193.    (C:/Qt/4.7.2-vc)
  194. Qmake failed, return code -1
  195.  
  196. Generating Makefiles...
  197. execute: Unknown error
  198.    (-r)
  199.    (C:/Qt/4.7.2-vc/projects.pro)
  200.    (-o)
  201.    (C:/Qt/4.7.2-vc)
  202. Qmake failed, return code -1
  203.  
  204.  
  205. C:Qt4.7.2-vc>

May 16, 2011

ludde ludde
Robot Herder
298 posts

Since you seem to be getting different errors each time, maybe using a shadow build (see this page [doc.qt.nokia.com]) would help – just to make sure you are building from scratch every time you start building. (Shadow building works for for Windows too, not just Windows CE, but you have to use the ‘-nomake examples’ configure option with Qt 4.7.3.) Alternatively, you could run ‘nmake distclean’ to clean things up, but I don’t know if you can be 100% sure that it really does clean everything.

September 8, 2011

THSQT THSQT
Lab Rat
1 posts

I always have the same error:

c:\qt\4.7.2\include\qtcore\../../src/corelib/global/qt_windows.h(63) : fatal err
or C1083: Cannot open include file: ‘windows.h’: No such file or directory
NMAKE : fatal error U1077: ‘“c:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\BIN\cl.EXE”’ : return code ‘0×2’
Stop.
Building qmake failed, return code 2

I’ve followed agent8261 instructions up to step 11

1: I uninstalled all the QT binaries.

2: I deleted the Qt folder.

3: I downloaded the Visual Studio Add-in [qt.nokia.com]

4: I installed the visual studio add-in

5: I downloaded the Qt source code [get.qt.nokia.com]

6: I created New folders c:\Qt\4.7.2-vc\ and extracted the source code to it.

7: I set the environment variables:

QTDIR = C:\Qt\4.7.2-vc\

QMAKESPEC = win32-msvc2010

8: I added to the Path variable:

cd C:\Qt\4.7.2-vc\bin

!!Check!!
If you set it up like I did, then you should be able to do:

C:\Qt\4.7.2-vc\configure.exe -help

from the windows cmd prompt.

9: I downloaded the lasts version of “jom”: ftp://ftp.qt.nokia.com/jom/

10: I created the folder C:\Qt\4.7.2-vc\jom extracted the jom files to it

11: I restarted windows then opened the VISUAL STUDIO command prompt and ran

C:
cd C:\Qt\4.7.2-vc
configure -debug-and-release -opensource -platform win32-msvc2010

What can I do????????
Thanks

September 9, 2011

steno steno
Ant Farmer
76 posts
muntoo wrote:
I’ve installed the Visual Studio 2010 Add-in. I’m still not sure whether I have to compile the source code, or if any of the installers will work with Visual Studio 2010.

The vs2008 installer works fine for me on vs2010. I don’t ever build from source with the installers…

Page  
1

  ‹‹ Errors when building QT 4.7.3 from source      VS2005 add ce build - THis Qt version is not compatible to your current VS ››

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