I'm stuck trying to get the latest NaviServer to build on Windows, due
to the OpenSSL support integrated a while back.  Does anyone have
advice on how I should debug this?

I'm using the pre-compiled Windows OpenSSL libraries build found here:

  http://www.slproweb.com/products/Win32OpenSSL.html
  Win32OpenSSL-1_1_1a.exe

Below in my nmake run, you can see that tclhttp.c throws warnings
about not finding SSL_get_version and SSL_get_cipher, and then the nsd
DLL and EXE files fail to link.

Originally the link threw two errors like this:

  tclhttp.o : error LNK2019: unresolved external symbol _SSL_get_cipher  
referenced in function _HttpConnect
  tclhttp.o : error LNK2019: unresolved external symbol _SSL_get_version 
referenced in function _HttpConnect

But then I fixed my build commands, and the _SSL_get_version error
went away.  Weirdly, the _SSL_get_cipher link error is still there,
even though it is defined in that same OpenSSL library!  I don't know
why.

In nsd/tclhttp.c, if I add a line to include openssl/ssl.h, the
undefined warnings go away, but then I get much worse errors:

  error C2371:  'intmax_t' : redefinition; different basic types
  error C2371: 'uintmax_t' : redefinition; different basic types

I attempted to edit openssl/ssl.h to remove the intmax_t and uintmax_t
typedefs, but that didn't seem to work.  So I stopped trying to
include ssl.h

Currently I am stuck...  Any helpful hints?

Note, the run below required some hacks to Makefile.win32 and
include/Makefile.win32 to get this far, so you can't just run it
verbatim:

------------------------------------------------------------
Z:\src\web\ns-fork-dtk\naviserver>nmake -f Makefile.win32  _nsd  
NAVISERVER=..\naviserver

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

openssl_dir is set to [1]:  C:\P\OpenSSL-Win32
Appending to LIB and INCLUDE.
        pushd nsd & nmake /nologo TCLPATH="C:\P\Tcl-32" TCLLIB="tcl85.lib" 
LIB="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Lib;C:\Program 
Files\Microsoft 
SDKs\Windows\v7.1\Lib;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Windows\Microsoft.NET\Framework\v3.5;;;C:\P\Tcl-32\lib;C:\P\OpenSSL-Win32\lib;C:\P\OpenSSL-Win32\lib\VC;C:\P\OpenSSL-Win32\lib\VC\static"
 DEBUG=1 openssl_dir=C:\P\OpenSSL-Win32 & popd
Library names are:  DLLBIN: libnsd.dll  DLLLIB: libnsd.lib
        cl /W3 /nologo /c /EHsc /MDd /Od /Zi /RTC1 /I "..\include" /I 
"C:\P\OpenSSL-Win32\include"  /I "C:\P\Tcl-32\include" /D "_WINDOWS" /D 
"TCL_THREADS=1"  /D "FD_SETSIZE=128" /D "_MBCS"  /D _CRT_SECURE_NO_WARNINGS /D 
_CRT_SECURE_NO_DEPRECATE /D _USE_32BIT_TIME_T /D "_DEBUG" /c /Fotclhttp.o 
tclhttp.c
tclhttp.c
tclhttp.c(1950) : warning C4013: 'SSL_get_version' undefined; assuming extern 
returning int
tclhttp.c(1950) : warning C4047: 'function' : 'const char *' differs in levels 
of indirection from 'int'
tclhttp.c(1950) : warning C4024: 'HttpTaskAddInfo' : different types for formal 
and actual parameter 3
tclhttp.c(1951) : warning C4013: 'SSL_get_cipher' undefined; assuming extern 
returning int
tclhttp.c(1951) : warning C4047: 'function' : 'const char *' differs in levels 
of indirection from 'int'
tclhttp.c(1951) : warning C4024: 'HttpTaskAddInfo' : different types for formal 
and actual parameter 3
        link.exe /NOLOGO /SUBSYSTEM:CONSOLE /OPT:NOREF /OPT:NOICF /DEBUG  /DLL 
/OUT:libnsd.dll /IMPLIB:libnsd.lib     adpcmds.o adpeval.o adpparse.o 
adprequest.o auth.o binder.o  cache.o callbacks.o cls.o compress.o config.o 
conn.o connio.o  cookies.o connchan.o  crypt.o dns.o driver.o dstring.o 
encoding.o event.o exec.o  fastpath.o fd.o filter.o form.o httptime.o index.o 
info.o  init.o limits.o lisp.o listen.o log.o mimetypes.o modload.o nsconf.o  
nsmain.o nsthread.o op.o pathname.o pidfile.o proc.o progress.o queue.o  
quotehtml.o random.o range.o request.o return.o returnresp.o rollfile.o  
sched.o server.o set.o sls.o sock.o sockcallback.o sockfile.o str.o  task.o 
tclcache.o tclcallbacks.o tclcmds.o tclconf.o tclenv.o tclfile.o  tclhttp.o 
tclimg.o tclinit.o
tcljob.o tclmisc.o tclobj.o tclobjv.o  tclrequest.o tclresp.o tclsched.o 
tclset.o tclsock.o sockaddr.o  tclthread.o tcltime.o tclvar.o tclxkeylist.o 
tls.o stamp.o  url.o url2file.o urlencode.o urlopen.o urlspace.o uuencode.o  
unix.o watchdog.o nswin32.o tclcrypto.o   /LIBPATH:"..\nsthread" nsthread.lib 
"/LIBPATH:C:\P\OpenSSL-Win32\lib\VC" libssl32MDd.lib libcrypto32MDd.lib 
/LIBPATH:"C:\P\Tcl-32\lib" tcl85.lib tcl85.lib kernel32.lib advapi32.lib 
ws2_32.lib user32.lib
   Creating library libnsd.lib and object libnsd.exp
tclhttp.o : error LNK2019: unresolved external symbol _SSL_get_cipher 
referenced in function _HttpConnect
libnsd.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 
10.0\VC\Bin\link.exe"' : return code '0x460'
Stop.
------------------------------------------------------------

-- 
Andrew Piskorski <a...@piskorski.com>


_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to