0
我正在嘗試使用sqlpp-connector-mysql建立數據庫連接。當我試圖運行建設這個項目後SampleTest.cpp
它產生錯誤說爲什麼`sqlpp-mysql`不適合鏈接?
$ g++ -std=c++1y -lsqlpp-mysql SampleTest.cpp
SampleTest.cpp:(.text+0x12f): undefined reference to `sqlpp::mysql::connection::connection(std::shared_ptr<sqlpp::mysql::connection_config> const&)'
SampleTest.cpp:(.text+0x13e): undefined reference to `sqlpp::mysql::connection::~connection()'
SampleTest.cpp:(.text+0x157): undefined reference to `sqlpp::mysql::connection::connection(std::shared_ptr<sqlpp::mysql::connection_config> const&)'
SampleTest.cpp:(.text+0x19d): undefined reference to `sqlpp::mysql::connection::execute(std::string const&)'
SampleTest.cpp:(.text+0x201): undefined reference to `sqlpp::mysql::connection::execute(std::string const&)'
SampleTest.cpp:(.text+0x265): undefined reference to `sqlpp::mysql::connection::execute(std::string const&)'
SampleTest.cpp:(.text+0x2c9): undefined reference to `sqlpp::mysql::connection::execute(std::string const&)'
我認爲,sqlpp-mysql
未正確連接。有人可以給我一些指針,如何解決這個問題?
P.S:我已經建立了要求。
我建立了兩個sqlpp11
和sqlpp11-connector-mysql
這樣
$ cd project_dir
$ cmake CmakeList.txt
$ sudo make install