尝试将mysql与cpp连接。我该如何解决这个错误?
=> MySQL Connector / C ++ 1.1
=> cmake版本3.12.4
=> c ++ --version
Apple LLVM版本10.0.0(clang-1000.10.44.2)
目标:x86_64-apple-darwin18.0.0
线程模型:posix
InstalledDir:/ Library / Developer / CommandLineTools / usr / bin
=> clang --version
Apple LLVM版本10.0.0(clang-1000.10.44.2)
目标:x86_64-apple-darwin18.0.0
线程模型:posix
InstalledDir:/ Library / Developer / CommandLineTools / usr / bin
已执行命令:
$ cd mysql-connector-cpp-master
$ sudo cmake .
$ sudo make clean
$ sudo make
$ sudo make
[ 1%] Building CXX object driver/CMakeFiles/mysqlcppconn-static.dir/mysql_art_resultset.cpp.o
[ 1%] Building CXX object driver/CMakeFiles/mysqlcppconn-static.dir/mysql_art_rset_metadata.cpp.o
[ 2%] Building CXX object driver/CMakeFiles/mysqlcppconn-static.dir/mysql_connection.cpp.o
.
.
.
.
[ 29%] Building CXX object driver/CMakeFiles/mysqlcppconn.dir/nativeapi/mysql_native_statement_wrapper.cpp.o
[ 29%] Building CXX object driver/CMakeFiles/mysqlcppconn.dir/nativeapi/mysql_native_resultset_wrapper.cpp.o
[ 30%] Linking CXX shared library libmysqlcppconn.dylib
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [driver/libmysqlcppconn.6.1.1.1.dylib] Error 1
make[1]: *** [driver/CMakeFiles/mysqlcppconn.dir/all] Error 2
make: *** [all] Error 2