xyssl-0.8是一个加密算法包,用visual 2010 编译时失败,改用mingw在windows下编译, 提示有网络函数找不到错误
- $ make
- CC aes.c
- CC arc4.c
- CC base64.c
- CC bignum.c
- CC certs.c
- CC debug.c
- CC des.c
- CC dhm.c
- CC havege.c
- CC md2.c
- CC md4.c
- CC md5.c
- CC net.c
- CC padlock.c
- CC rsa.c
- CC sha1.c
- CC sha2.c
- CC sha4.c
- CC ssl_cli.c
- CC ssl_srv.c
- CC ssl_tls.c
- CC timing.c
- CC x509parse.c
- AR libxyssl.a
- C:\MinGW\bin\ar.exe: creating libxyssl.a
- CC aes/aescrypt2.c
- CC hash/hello.c
- CC hash/md5sum.c
- CC hash/sha1sum.c
- CC hash/sha2sum.c
- CC pkey/dh_client.c
- ../library/libxyssl.a(net.o):net.c:(.text+0x15): undefined reference to `WSAGetLastError@0'
- ../library/libxyssl.a(net.o):net.c:(.text+0x4b): undefined reference to `WSAStartup@8'
- ../library/libxyssl.a(net.o):net.c:(.text+0x70): undefined reference to `gethostbyname@4'
- ../library/libxyssl.a(net.o):net.c:(.text+0x99): undefined reference to `socket@12'
- ../library/libxyssl.a(net.o):net.c:(.text+0xf8): undefined reference to `connect@12'
- ../library/libxyssl.a(net.o):net.c:(.text+0x110): undefined reference to `closesocket@4'
- ../library/libxyssl.a(net.o):net.c:(.text+0x173): undefined reference to `WSAStartup@8'
- ../library/libxyssl.a(net.o):net.c:(.text+0x1a5): undefined reference to `socket@12'
- ../library/libxyssl.a(net.o):net.c:(.text+0x1e8): undefined reference to `setsockopt@20'
- ../library/libxyssl.a(net.o):net.c:(.text+0x2f5): undefined reference to `bind@12'
- ../library/libxyssl.a(net.o):net.c:(.text+0x306): undefined reference to `closesocket@4'
- ../library/libxyssl.a(net.o):net.c:(.text+0x322): undefined reference to `listen@8'
- ../library/libxyssl.a(net.o):net.c:(.text+0x333): undefined reference to `closesocket@4'
- ../library/libxyssl.a(net.o):net.c:(.text+0x3be): undefined reference to `accept@12'
- ../library/libxyssl.a(net.o):net.c:(.text+0x421): undefined reference to `ioctlsocket@12'
- ../library/libxyssl.a(net.o):net.c:(.text+0x44f): undefined reference to `ioctlsocket@12'
- ../library/libxyssl.a(net.o):net.c:(.text+0x495): undefined reference to `select@20'
- ../library/libxyssl.a(net.o):net.c:(.text+0x4c6): undefined reference to `recv@16'
- ../library/libxyssl.a(net.o):net.c:(.text+0x4e3): undefined reference to `WSAGetLastError@0'
- ../library/libxyssl.a(net.o):net.c:(.text+0x532): undefined reference to `send@16'
- ../library/libxyssl.a(net.o):net.c:(.text+0x547): undefined reference to `WSAGetLastError@0'
- ../library/libxyssl.a(net.o):net.c:(.text+0x57d): undefined reference to `shutdown@8'
- ../library/libxyssl.a(net.o):net.c:(.text+0x588): undefined reference to `closesocket@4'
- collect2: ld returned 1 exit status
- make[1]: *** [pkey/dh_client] Error 1
- make: *** [all] Error 2
修改programs/Makefile, 增加-lwsock32的链接后编译成功
LDFLAGS = -L../library -lxyssl -lwsock32