> From: owner-openssl-us...@openssl.org On Behalf Of weihao.ma
> Sent: Monday, 28 September, 2009 09:06

> hi,can somebody help me fixing the problem~
> 
> The client and server is the book of Network Security with 
> OpenSSL(O'Reilly) in chapter 5. 
> 
> gcc -o client client.o common.o ..\out\libssl.a ..\out\libcrypto.a
> ..\out\libcrypto.a(bss_conn.o): In function `conn_state':
> D:/PROJECTS/C/openssl/./crypto/bio/bss_conn.c:203: undefined 
> reference to `_ht...@4'
<snip: etc etc and>
> ..\out\libcrypto.a(rand_win.o): In function `readscreen':
> D:/PROJECTS/C/openssl/./crypto/rand/rand_win.c:708: undefined 
> reference to `_create...@16'

On (modern) Windows any socket program must be linked with the 
ws2_32 (winsock) import library, so at runtime it will use the DLL.
OpenSSL also uses a few Windows specific features that require 
some other Windows library/DLLs; the list I currently link is 
  user32.lib advapi32.lib kernel32.lib gdi32.lib 
although I'm not certain all of these are really needed.

You're apparently using mingw; it provides converted versions 
of the Windows import libs as lib/lib*.a so you can just use 
-lws2_32 etc. in the usual way.



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org
  • undefined reference weihao.ma
    • RE: undefined reference: (mingw?) Windows sockets+ Dave Thompson

Reply via email to