c - Undefined reference to winsock when using crypto library -


i have program worked fine using winsock in c. i've trked add ssl program, getting errors such as

c:\program files\gnuwin32\lib\libcrypto.a(bss_sock.o):bss_sock.c|| undefined reference `shutdown@8'| c:\program files\gnuwin32\lib\libcrypto.a(bss_sock.o):bss_sock.c|| undefined reference `shutdown@8'| c:\program files\gnuwin32\lib\libcrypto.a(bss_sock.o):bss_sock.c|| undefined reference `wsasetlasterror@4'| c:\program files\gnuwin32\lib\libcrypto.a(bss_sock.o):bss_sock.c|| undefined reference `recv@16'| c:\program files\gnuwin32\lib\libcrypto.a(bss_sock.o):bss_sock.c|| undefined reference `wsasetlasterror@4'| 

as if libcrypto can't find winsock functions. winsock2 linked , program compiles fine without crypto library.

i using code::blocks , have following:

-lws2_32 -lssl -lcrypto  #include <winsock2.h> #include <ws2tcpip.h>  #include <stdio.h> #include <openssl/ssl.h> #include <openssl/crypto.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/err.h> 

i can't figure out why getting these linking errors, please help!


Comments