Hi,
I am trying to compile OpenSSL V0.9.8a with MS VC/C++ V8.0, which is the
version in Visual Studio 2005.
The compiling fails with a series of errors, which were trivial to fix, except
for the last one.
The readme says I should try the following first:
- Download the current snapshot from ftp://ftp.openssl.org/snapshot/
to see if the problem has already been addressed
I downloaded openssl-0.9.8-stable-SNAP-20051113.
- Remove ASM versions of libraries
I guess this means not to use the assembler-optimizations, so I used
ms\do_ms.bat instead.
- Remove compiler optimisation flags
I removed all parameters from CFLAG in ms\ntdll.mak that started with /O (the
optimization options according to "cl /?").
I still get the same errors, though.
I am using the following system:
- Virtual machine in VMware Workstation V5.0.0.13124 on an AMD Athlon 2600+ and
512 MByte RAM in the VM.
- Windows Server 2003 Standard Edition with SP1 and all latest WindowsUpdates.
- MS Visual Studio 2005 Professional.
- ActivePerl 813.
Below is a list of the errors from the compiler.
The first 6 errors were easy enough to handle, it's just a question of changing
read to _read and so on.
The 7th error is beyond me though (I am not a programmer by training or
profession).
1. ***********************************************
Error:
---8<---
cl /Fotmp32dll\enc_read.obj -Iinc32 -Itmp32dll /MD /W3 /WX /Gs0 /GF
/Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN
-DDSO_WIN32 -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_USE_APPLINK -I. /Fdout32dll
-DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_KRB5
-DOPENSSL_NO_DYNAMIC_ENGINE -D_WINDLL -DOPENSSL_BUILD_SHLIBCRYPTO -c
.\crypto\des\enc_read.c
enc_read.c
.\crypto\des\enc_read.c(150) : error C2220: warning treated as error - no
'object' file generated
.\crypto\des\enc_read.c(150) : warning C4996: 'read' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\io.h(329) : see
declaration of 'read'
Message: 'The POSIX name for this item is deprecated. Instead, use the
ISO C++ conformant name: _read. See online help for details.'
.\crypto\des\enc_read.c(172) : warning C4996: 'read' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\io.h(329) : see
declaration of 'read'
Message: 'The POSIX name for this item is deprecated. Instead, use the
ISO C++ conformant name: _read. See online help for details.'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
---8<---
Solution:
Change line 150 in crypto\des\enc_read.c from:
i=read(fd,(void *)&(net[net_num]),HDRSIZE-net_num);
To:
i=_read(fd,(void *)&(net[net_num]),HDRSIZE-net_num);
Change line 172 in crypto\des\enc_read.c from:
i=read(fd,(void *)&(net[net_num]),rnum-net_num);
To:
i=_read(fd,(void *)&(net[net_num]),rnum-net_num);
2. ***********************************************
Error:
---8<---
cl /Fotmp32dll\enc_writ.obj -Iinc32 -Itmp32dll /MD /W3 /WX /Gs0 /GF
/Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN
-DDSO_WIN32 -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_USE_APPLINK -I. /Fdout32dll
-DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_KRB5
-DOPENSSL_NO_DYNAMIC_ENGINE -D_WINDLL -DOPENSSL_BUILD_SHLIBCRYPTO -c
.\crypto\des\enc_writ.c
enc_writ.c
.\crypto\des\enc_writ.c(156) : error C2220: warning treated as error - no
'object' file generated
.\crypto\des\enc_writ.c(156) : warning C4996: 'write' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\io.h(334) : see
declaration of 'write'
Message: 'The POSIX name for this item is deprecated. Instead, use the
ISO C++ conformant name: _write. See online help for details.'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
---8<---
Solution:
Change line 156 in crypto\des\enc_writ.c from:
i=write(fd,(void *)&(outbuf[j]),outnum-j);
To:
i=_write(fd,(void *)&(outbuf[j]),outnum-j);
3. ***********************************************
Error:
---8<---
cl /Fotmp32dll\bss_file.obj -Iinc32 -Itmp32dll /MD /W3 /WX /Gs0 /GF
/Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN
-DDSO_WIN32 -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_USE_APPLINK -I. /Fdout32dll
-DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_KRB5
-DOPENSSL_NO_DYNAMIC_ENGINE -D_WINDLL -DOPENSSL_BUILD_SHLIBCRYPTO -c
.\crypto\bio\bss_file.c
bss_file.c
.\crypto\bio\bss_file.c(275) : error C2220: warning treated as error - no
'object' file generated
.\crypto\bio\bss_file.c(275) : warning C4996: 'fileno' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\stdio.h(688) :
see declaration of 'fileno'
Message: 'The POSIX name for this item is deprecated. Instead, use the
ISO C++ conformant name: _fileno. See online help for details.'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
---8<---
Solution:
Change line 275 in crypto\bio\bss_file.c:
int fd = fileno((FILE*)ptr);
To:
int fd = _fileno((FILE*)ptr);
4. ***********************************************
Error:
---8<---
cl /Fotmp32dll\randfile.obj -Iinc32 -Itmp32dll /MD /W3 /WX /Gs0 /GF
/Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN
-DDSO_WIN32 -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_USE_APPLINK -I. /Fdout32dll
-DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_KRB5
-DOPENSSL_NO_DYNAMIC_ENGINE -D_WINDLL -DOPENSSL_BUILD_SHLIBCRYPTO -c
.\crypto\rand\randfile.c
randfile.c
.\crypto\rand\randfile.c(184) : error C2220: warning treated as error - no
'object' file generated
.\crypto\rand\randfile.c(184) : warning C4996: 'chmod' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\io.h(316) : see
declaration of 'chmod'
Message: 'The POSIX name for this item is deprecated. Instead, use the
ISO C++ conformant name: _chmod. See online help for details.'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
---8<---
Solution:
Change line 184 in crypto\rand\randfile.c from:
chmod(file,0600);
To:
_chmod(file,0600);
5. ***********************************************
Error:
---8<---
cl /Fotmp32dll\ui_openssl.obj -Iinc32 -Itmp32dll /MD /W3 /WX /Gs0 /GF
/Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN
-DDSO_WIN32 -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_USE_APPLINK -I. /Fdout32dll
-DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_KRB5
-DOPENSSL_NO_DYNAMIC_ENGINE -D_WINDLL -DOPENSSL_BUILD_SHLIBCRYPTO -c
.\crypto\ui\ui_openssl.c
ui_openssl.c
.\crypto\ui\ui_openssl.c(681) : error C2220: warning treated as error - no
'object' file generated
.\crypto\ui\ui_openssl.c(681) : warning C4996: 'getch' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\conio.h(145) :
see declaration of 'getch'
Message: 'The POSIX name for this item is deprecated. Instead, use the
ISO C++ conformant name: _getch. See online help for details.'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
---8<---
Solution:
Change line 681 in crypto\ui\ui_openssl.c from:
i=getch();
To:
i=_getch();
6. ***********************************************
Error:
---8<---
cl /Fotmp32dll\e_aep.obj -Iinc32 -Itmp32dll /MD /W3 /WX /Gs0 /GF /Gy
/nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32
-D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_USE_APPLINK -I. /Fdout32dll
-DOPENSSL_NO_RC5 -DOPENSSL_O_MDC2 -DOPENSSL_NO_KRB5 -DOPENSSL_NO_DYNAMIC_ENGINE
-D_WINDLL -DOPENSSL_BUILD_SHLIBCRYPTO -c .\engines\e_aep.c
e_aep.c
.\engines\e_aep.c(866) : error C2220: warning treated as error - no 'object'
file generated
.\engines\e_aep.c(866) : warning C4996: 'getpid' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\process.h(227) :
see declaration of 'getpid'
Message: 'The POSIX name for this item is deprecated. Instead, use the
ISO C++ conformant name: _getpid. See online help for details.'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
---8<---
Solution:
Change line 866 in engines\e_aep.c from:
curr_pid = getpid();
To:
curr_pid = _getpid();
7. ***********************************************
Error:
---8<---
rc /fo"tmp32dll\libeay32.res" /d CRYPTO ms\version32.rc
link /nologo /subsystem:console /machine:I386 /opt:ref /dll
/out:out32dll\libeay32.dll /def:ms/LIBEAY32.def
@C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nmDD.tmp
ms/LIBEAY32.def(7) : warning LNK4017: DESCRIPTION statement not supported for
the target platform; ignored
Creating library out32dll\libeay32.lib and object out32dll\libeay32.exp
cl /Fotmp32dll\s2_meth.obj -Iinc32 -Itmp32dll /MD /W3 /WX /Gs0 /GF /Gy
/nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32
-D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_USE_APPLINK -I. /Fdout32dll
-DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_KRB5
-DOPENSSL_NO_DYNAMIC_ENGINE -D_WINDLL -DOPENSSL_BUILD_SHLIBSSL -c
.\ssl\s2_meth.c
s2_meth.c
cl /Fotmp32dll\s2_srvr.obj -Iinc32 -Itmp32dll /MD /W3 /WX /Gs0 /GF /Gy
/nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32
-D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_USE_APPLINK -I. /Fdout32dll
-DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_KRB5
-DOPENSSL_NO_DYNAMIC_ENGINE -D_WINDLL -DOPENSSL_BUILD_SHLIBSSL -c
.\ssl\s2_srvr.c
s2_srvr.c
.\ssl\s2_srvr.c(147) : error C2220: warning treated as error - no 'object' file
generated
.\ssl\s2_srvr.c(147) : warning C4244: 'initializing' : conversion from 'time_t'
to 'unsigned long', possible loss of data
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
---8<---
Solution:
?
***********************************************
Additionally, I think the linker options have changed too.
Here's a line from ms\ntdll.mak:
LFLAGS=/nologo /subsystem:console /machine:I386 /opt:ref
Here's output from "link /?":
...
/MACHINE:{ARM|EBC|IA64|MIPS|MIPS16|MIPSFPU|MIPSFPU16|
SH4|THUMB|X64|X86}
...
"/machine:I386" should probably read "/machine:X86" now, but I have no way of
knowing since the compiler stopped before the linker was invoked.
With kind regards,
Petri Oksanen
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]