在Linux和Windows上,在我的项目中集成OpenWall bcrypt库时遇到问题。
这就是我所做的:
我的bash文件用于编译:
project_root=/home/ubuntu/lamodal-dev
lws_lib_dir_path=/usr/local/lib
libxml_include_dir_path=/usr/include/libxml2
lws_lib_name=websockets
libxml_lib_name=xml2
sqlite3_lib_name=sqlite3
debug_compile_flags="\
-g \
-Wall \
-Wno-unused-variable \
-Wno-unused-but-set-variable \
-Wno-unused-result"
g++ -pthread -std=c++11 $debug_compile_flags \
-I$libxml_include_dir_path \
-L$lws_lib_dir_path \
$project_root/code/third/openwall/bcrypt/crypt_blowfish.o \
$project_root/code/third/openwall/bcrypt/crypt_gensalt.o \
$project_root/code/third/openwall/bcrypt/wrapper.o \
$project_root/code/third/openwall/bcrypt/x86.o \
../../code/lamodal-dev.cpp \
-l$lws_lib_name \
-l$libxml_lib_name \
-l$sqlite3_lib_name \
-lcrypt \
-o ../../bin/linux/lamodal-dev.run
输出:
undefined reference to `crypt_gensalt(char const*, unsigned long, char const*, int)'
我不应该链接的东西是什么?