Error compiling OpenSSL for Win32 - windows

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.

Related

Specify include directories for resources in command line

I am trying to build cURL on Windows using the following line:
nmake vc-x64 mode=dll VC=10 MACHINE=x64
Now I have done this setup before building:
set PATH=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64;%PATH%
set INCLUDE="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include";"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"
set LIB="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\amd64";"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64"
set LIBPATH="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib\amd64"
set PATH="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\x64";%PATH%)
set INCLUDE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include";%INCLUDE%
set LIB="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\x64";%LIB%
I get the following error:
rc /dDEBUGBUILD=0 /Fo ..\builds\libcurl-vc10-x64-release-dll-ipv6-sspi-w
inssl-obj-lib\libcurl.res ..\lib\libcurl.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385
Copyright (C) Microsoft Corporation. All rights reserved.
..\lib\libcurl.rc(22) : fatal error RC1015: cannot open include file 'winver.h'.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A
\Bin\x64\rc.EXE"' : return code '0x1'
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: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\bin\amd64\nmake.EXE"' : return code '0x2'
Stop.
It does not seem to find the file "winver.h" despite the fact that this file is in the directory "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include", and that this directory is in my INCLUDE variable.
It looks like rc does not take in account the variable INCLUDE to find the include paths. Is there a way to add an include path for the rc command? Unless this is something completely different of course.

Clang C2 on Visual studio 15.5 bool_constant<__is_trivially_destructible(_Ty)> error : '_Ty' does not refer to a value

I am trying to re-compile a hello world using Clang_C2 compiler on Visual studio 15.5 (latest).
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include\type_traits(899,2): error : expected class name
1> { // determine whether _Ty has a trivial destructor
In file included from ..\hello_boost_exception\hello_boost_exception.cpp:11:
1>In file included from I:\modular-boost\boost/config.hpp:48:
1>In file included from I:\modular-boost\boost/config/stdlib/dinkumware.hpp:98:
1>In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include\typeinfo:22:
1>In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include\exception:7:
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include\type_traits(898,47):
This looks as though I have some missing or incorrect library but I can't see what.
I have try various compiler versions C++14 (-std=c++1y) and library -stdlib=libc++ (should it use dinkumware version of type_traits?) but the error persists.
Suggestions most welcome.
Paul

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.

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!

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

Resources