Link error using Visual Studio 2010 command prompt - windows

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.

Related

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 ;)

Fatal error when compiling Qt in Windows

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

Qt 4.8.3 Windows 7 Compile Using Visual Studio Express 2012

I'm still new to Qt. In the past I used to download Qt on a computer and install it without any problems and I get immediate access to all Qt SDK resources including QtCreator.
Now, I downloaded Qt SDK 4.8.3 and after some reading I ended up installing Windows SDK 7. Then I extracted Qt files to C:\Qt. I also added C:\Qt\4.8.3\ to the system path. Then I ran configure which is concluded with no errors. Then I attempted to run nmake which failed with 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.intermediate.manifest" /VERSION:4.83 /OUT:....\lib\QtCored4.dll #C:\Users\MELKAM~1\AppData\Local\Temp\nm5A03.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: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\Bin\amd64\link.EXE"' : return code '0x463'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\Bin\amd64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
Now I have tried the above twice with no luck. Any pointer where should I look? any suggestions are appreciated.
Thanks.
What are you compiling with? MSVC or mingw? If the former, I have found this link incredibly helpful...
http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/
I have followed his instructions for 64bit and 32bit builds many times.
Edit: You have your qt build configured for a MSVC2010 (1600) build, so it's looking in the "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\nmake.exe" directory, which doesn't exist if you only have MSVC2012 (which is version 11.0).
Qt 4.8 doesn't officially support MSVC2012 (yet?), but if you really want to use 2012 then you can try the suggestions at this link. It's complicated, especially if this is your first source build, but seems do-able if you're willing to tinker with the Qt source code.
I had the same issue. the problem was installing visual studio 2012 on a machine with visual studio 2010.
May be this can help https://stackoverflow.com/a/15132209/1933829
Did you run configure from the 64bit tools command tool in vs?
Did you add -platform win32-msvc2010 to the configure commandline (yes even for 64bit builds you need -win32- )

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