0
我在C++
裏做了一個TCP套接字程序,使用wsock32
和openssl
,但是我想鏈接openssl
static。undefined reference C++ mingw32
我編譯openssl
mingw32
共享和不共享,但我一直收到相同的未定義的參考錯誤。
如果我連接.a.dll
而不是.a
,它會生成很好,但我不想使用dll。
以下是我編譯:
/c/MinGW/bin/mingw32-g++.exe main.cpp -I /c/Mingw-builds/openssl/include -L/c/MinGW/lib -L /c/Mingw-builds/openssl/lib -std=c++11 -lwsock32 -lshlwapi -lws2_32 -lssl -lcrypto -lgdi32
錯誤,我得到:
C:/Mingw-builds/openssl/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xac): undefined reference to `[email protected]'
C:/Mingw-builds/openssl/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0x6ef): undefined reference to `[email protected]'
C:/Mingw-builds/openssl/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xa28): undefined reference to `[email protected]'
C:/Mingw-builds/openssl/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0xe6): undefined reference to `[email protected]'
C:/Mingw-builds/openssl/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x2d6): undefined reference to `[email protected]'
C:/Mingw-builds/openssl/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x40b): undefined reference to `[email protected]'
C:/Mingw-builds/openssl/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x43b): undefined reference to `[email protected]'
C:/Mingw-builds/openssl/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x4a0): undefined reference to `[email protected]'
請訪問http://計算器。 COM /問題/ 3363398 /克聯階依賴性-當聯-C-碼到C代碼。 – Holt