Fatal error when compiling Qt in Windows - visual-studio-2010

I tried to build Qt 5.0.1 with MSVS2010 in Windows 7.
These are my steps:
Extract source code into C:\Qt\5.0.1
Start VS2010 command prompt
Type configure (this step took approximately 45 minute)
Type nmake
After an hour I get the following error:
"C:\Program Files (x86)\Microsoft DirectX SDKUtilities\bin\x86\fxc.exe"
/nologo /E standardvs /T vs_2_0 /Fh shaders\standardvs.h ..\..\..\3rdparty\angle
\src\libGLESv2\shaders\Blit.vs
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft DirectX SDKUtiliti
es\bin\x86\fxc.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\bin\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
I searched online, and saw many solutions, but none of them solved my problem.
I even re-installed Windows and repeated those steps but I got the same error again.

You have spaces and parenthesis in your env paths. Try to use short path, you can get them by opening a Windows command prompt with cmd and type dir /X. Short names will be in front of corresponding directories
for example, if you have a script to set up your environment :
SET VISUALDIR=C:\Program Files\Microsoft Visual Studio 9.0
SET PATH=%VISUALDIR%\VC\bin;%PATH%
becomes
SET VISUALDIR=C:\PROGRA~1\MICROS~1.0
SET PATH=%VISUALDIR%\VC\bin;%PATH%
If you have no script, the faulty path could be set in the default Windows PATH environment variable. Then you'll have to manually edit PATH variable and apply short paths here.
windows power

Related

Link error using Visual Studio 2010 command prompt

When building Openssl source code using Visual Studio x64 Win64 command prompt(2010) getting error:
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\amd64\link.EXE"' : return code '0x463' Stop.
How do I resolve this issue?
Thanks in Advance.

QT build fails with NMAKE : fatal error U1077: 'echo' : return code '0x1'

I am using QT and CMake to build application for windows. When I run my CMakeLists.txt file I get the following warning:
CMake Warning at c:/Program Files/CMake 3.4/share/cmake-3.4/Modules/InstallRequiredSystemLibraries.cmake:343 (message):
system runtime library file does not exist:
'MSVC10_REDIST_DIR-NOTFOUND/x86/Microsoft.VC100.CRT/msvcp100.dll'
Call Stack (most recent call first):
CMakeLists.txt:165 (INCLUDE)
CMake Warning at c:/Program Files/CMake 3.4/share/cmake-3.4/Modules/InstallRequiredSystemLibraries.cmake:343 (message):
system runtime library file does not exist:
'MSVC10_REDIST_DIR-NOTFOUND/x86/Microsoft.VC100.CRT/msvcr100.dll'
Call Stack (most recent call first):
CMakeLists.txt:165 (INCLUDE)
I found a post related to this warning but unlike the poster of that question I am not writing a GUI application. As I am new to using CMake I don't know how to make my linker flags correct. As this is just a warning in my CMake I can go ahead an finish the CMake anyway. The trouble is when I try to build my application I get the following compiler error:
CMake Error: No Script specified for argument -P
NMAKE : fatal error U1077: 'echo' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
12:02:32: The process "C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe" exited with code 2.
Error while building/deploying project openfls (kit: Desktop)
When executing step 'Make'
What I am asking is how do the warning that I get when running my CMake leading to the compiler error? If so how do I resolve the warning (editing the flags)? If not is it important to address the warning (or can I just ignore it) and what should I be doing to prevent the compiler error?
I resolved my cmake error by identifying some linux specific includes which windows did not know what to do with (things relating to CPACK). This however did not resolve the errors I got when I tried to build, answering my question as to whether the two were related.
The problem when I was building is that QT is not properly set up to build on this system (the environmental variables for libraries ect. were not set). This had not been a problem before building on this machine as previously using qmake it had used the microsoft visual compiler. So to resolve my error I ran my cmake manually outside of QT then opened the solution file in Visual C++.

how to build Qt5 with qtwebkit on Windows with MSVC 2008 - leveldb can't find stdint.h

On a Windows 7 x64 box:
I installed Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1
I downloaded and unzipped Qt5.4.0 source from the "Source packages and Other releases" section of http://www.qt.io/download-open-source/#
I built ICU 54.1 from source and installed it, per http://qt-project.org/wiki/Compiling-ICU-with-MSVC.
I created a command prompt shortcut per http://doc.qt.io/qt-5/windows-building.html.
I added stuff to the command prompt per http://qt-project.org/wiki/Building_Qt_5_from_Git and the Usage section of http://qt-project.org/wiki/Compiling-ICU-with-MSVC.
So my qt5vars.cmd is:
CALL "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat"
SET _ROOT=C:\qt\qt540
SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;C:\Python27;C:\Python27\Scripts;%PATH%
REM Uncomment the below line when using a git checkout of the source repository
REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH%
SET QMAKESPEC=win32-msvc2008
SET PATH=%PATH%;C:\icu\dist\lib;C:\Ruby193\bin
SET INCLUDE=%INCLUDE%;C:\icu\dist\include
SET LIB=%LIB%;C:\icu\dist\lib
SET _ROOT=
I updated qtwinextras\src\winextras\winshobjidl_p.h per Compiling Qt 5.3.2 + VS2008 + SDK7.1 error SHARDAPPIDINFOLINK.
Per https://groups.google.com/forum/#!topic/theano-users/JReP5_Ligu4 and C99 stdint.h header and MS Visual Studio, I copied stdint.h from C:\Program Files\Microsoft Visual Studio 10.0\VC\include on another machine, and pasted it into C:\Qt\qt540\qtwebkit\Source\WTF\wtf. I commented out the declaration of WCHAR_MIN, and copied that modified stdint.h to c:\qt\qt540\qtwebkit\source\javascriptcore\runtime.
With that setup, from the qt5vars.cmd prompt above, I configured Qt with:
configure -prefix %CD%\qtbase -developer-build -opensource -opengl
desktop -nomake tests -no-compile-examples -skip qtwebkit-examples
-icu -plugin-sql-sqlite -platform win32-msvc2008 -confirm-license
Then ran nmake. I get a bunch of errors that leveldb can't find stdint.h:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\db/filename.h(10) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
c.cc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/c.h(50) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
dbformat.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
db_impl.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
db_iter.cc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\db/db_iter.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
filename.cc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\db/filename.h(10) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
log_reader.cc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\db/log_reader.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
log_writer.cc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\db/log_writer.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
memtable.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
repair.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
table_cache.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\db/table_cache.h(11) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
version_edit.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
version_set.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
write_batch.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '(' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
There is a stdint.h in C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\port\win, but copying that file or my modified stdint.h to leveldb\db and leveldb\include\leveldb makes no difference - I get the same errors when building Qt.
What do I need to do to build qtwebkit with Qt, or at least get past this leveldb sdtint.h issue?
OK, I'm a dummy. Just needed to copy stdint.h to C:\Program Files\Microsoft Visual Studio 9.0\VC\include instead of to the path of every file that complains. Additionally, I commented out the declaration of WCHAR_MIN in stdint.h to avoid tons of warnings about redeclaring it.
Then using the configure statement in the original question, Qt5.4.0 built successfully, including qtwebkit! Took 11 hours to build, but it worked!

Building Qt 4.8.3 on Windows and integrating it with Microsoft Visual Studio 2010

I've been trying to build Qt 4.8.3 and everything went fine with configuring it (using the configure command). But when I try to run nmake, I get the following error:
Generating Code...
link /LIBPATH:"c:\Qt\4.8.3\lib" /LIBPATH:"c:\Qt\4.8.3\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /BASE:0x67000000 /DEBUG /DLL /MANIFEST
/MANIFESTFILE:"tmp\obj\debug_shared\QtCored.int 83
/OUT:....\lib\QtCored4.dll #C:\Users\Maikati\AppData\Local\Temp\nm6CC4.tmp
Creating library ....\lib\QtCored4.lib and object
....\lib\QtCored4.exp LINK : fatal error LNK1123: failure during
conversion to COFF: file invalid or corrupt NMAKE : fatal error U1077:
'D:\vs2010\VC\BIN\link.EXE' : return code '0x463'
Stop. NMAKE : fatal
error U1077: 'D:\vs2010\VC\BIN\nmake.exe' : return code '0x2' Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.
I've googled my error and there were almost no results with link.exe, so I decided to ask here. Any help will be appreciated ;)

Error compiling OpenSSL for Win32

I get the following error when trying to build OpenSSL on Win32:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\errno.h(92) : error C2220: warning treated as error - no 'object' file generated
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\errno.h(92) : warning C4005: 'EADDRINUSE' : macro redefinition
tmp32\e_os.h(153) : see previous definition of 'EADDRINUSE'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
I've followed the instructions in INSTALL.W32 to the letter. I configured with the no-asm flag. I am using Visual Studio Express 2010 C++.
Thank you for your time.
Apparently this a bug in OpenSSL 1.0.0. I downloaded the 1.0.0a source and it is compiling fine.

Resources