Support #3645
openi want to compile wt, and use wtdbomysql,but an error occurred
Description
Hi,
when i compiled wt 3.3.3 or 3.3.4 and enabled mysql, an error occurred, like this:
Linking CXX shared library libwtdbomysql.dylib
Undefined symbols for architecture x86_64:
"_mysql_close", referenced from:
Wt::Dbo::backend::MySQL::connect(std::_1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, unsigned int, std::1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
Wt::Dbo::backend::MySQL::~MySQL() in MySQL.o
"_mysql_commit", referenced from:
Wt::Dbo::backend::MySQL::commitTransaction() in MySQL.o
"_mysql_error", referenced from:
Wt::Dbo::backend::MySQL::connect(std::_1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, unsigned int, std::1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
Wt::Dbo::backend::MySQL::executeSql(std::_1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
Wt::Dbo::backend::MySQL::startTransaction() in MySQL.o
Wt::Dbo::backend::MySQL::commitTransaction() in MySQL.o
Wt::Dbo::backend::MySQL::rollbackTransaction() in MySQL.o
"_mysql_fetch_field_direct", referenced from:
Wt::Dbo::backend::MySQLStatement::bind_output() in MySQL.o
"_mysql_free_result", referenced from:
Wt::Dbo::backend::MySQL::executeSql(std::_1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
Wt::Dbo::backend::MySQL::startTransaction() in MySQL.o
Wt::Dbo::backend::MySQL::commitTransaction() in MySQL.o
Wt::Dbo::backend::MySQL::rollbackTransaction() in MySQL.o
Wt::Dbo::backend::MySQLStatement::execute() in MySQL.o
Wt::Dbo::backend::MySQLStatement::nextRow() in MySQL.o
Wt::Dbo::backend::MySQLStatement::~MySQLStatement() in MySQL.o
...
"_mysql_init", referenced from:
Wt::Dbo::backend::MySQL::connect(std::_1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, unsigned int, std::1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
"_mysql_num_fields", referenced from:
Wt::Dbo::backend::MySQLStatement::execute() in MySQL.o
Wt::Dbo::backend::MySQLStatement::nextRow() in MySQL.o
Wt::Dbo::backend::MySQLStatement::bind_output() in MySQL.o
Wt::Dbo::backend::MySQLStatement::free_outpars() in MySQL.o
"_mysql_options", referenced from:
Wt::Dbo::backend::MySQL::connect(std::_1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, unsigned int, std::1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
"_mysql_query", referenced from:
Wt::Dbo::backend::MySQL::executeSql(std::_1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
Wt::Dbo::backend::MySQL::startTransaction() in MySQL.o
"_mysql_real_connect", referenced from:
Wt::Dbo::backend::MySQL::connect(std::_1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, unsigned int, std::1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
"_mysql_rollback", referenced from:
Wt::Dbo::backend::MySQL::rollbackTransaction() in MySQL.o
"_mysql_server_init", referenced from:
_GLOBAL_I_a in MySQL.o
"_mysql_stmt_affected_rows", referenced from:
Wt::Dbo::backend::MySQLStatement::execute() in MySQL.o
"_mysql_stmt_attr_set", referenced from:
Wt::Dbo::backend::MySQLStatement::MySQLStatement(Wt::Dbo::backend::MySQL&, std::_1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
"_mysql_stmt_bind_param", referenced from:
Wt::Dbo::backend::MySQLStatement::execute() in MySQL.o
"_mysql_stmt_bind_result", referenced from:
Wt::Dbo::backend::MySQLStatement::bind_output() in MySQL.o
"_mysql_stmt_close", referenced from:
Wt::Dbo::backend::MySQLStatement::~MySQLStatement() in MySQL.o
"_mysql_stmt_error", referenced from:
Wt::Dbo::backend::MySQLStatement::MySQLStatement(Wt::Dbo::backend::MySQL&, std::_1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
Wt::Dbo::backend::MySQLStatement::execute() in MySQL.o
Wt::Dbo::backend::MySQLStatement::nextRow() in MySQL.o
"_mysql_stmt_execute", referenced from:
Wt::Dbo::backend::MySQLStatement::execute() in MySQL.o
"_mysql_stmt_fetch", referenced from:
Wt::Dbo::backend::MySQLStatement::nextRow() in MySQL.o
"_mysql_stmt_fetch_column", referenced from:
Wt::Dbo::backend::MySQLStatement::getResult(int, std::_1::basic_string<char, std::1::char_traits, std::_1::allocator >*, int) in MySQL.o
Wt::Dbo::backend::MySQLStatement::getResult(int, std::_1::vector<unsigned char, std::_1::allocator >*, int) in MySQL.o
"_mysql_stmt_field_count", referenced from:
Wt::Dbo::backend::MySQLStatement::execute() in MySQL.o
"_mysql_stmt_free_result", referenced from:
Wt::Dbo::backend::MySQLStatement::nextRow() in MySQL.o
"_mysql_stmt_init", referenced from:
Wt::Dbo::backend::MySQLStatement::MySQLStatement(Wt::Dbo::backend::MySQL&, std::_1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
"_mysql_stmt_insert_id", referenced from:
Wt::Dbo::backend::MySQLStatement::execute() in MySQL.o
"_mysql_stmt_param_count", referenced from:
Wt::Dbo::backend::MySQLStatement::MySQLStatement(Wt::Dbo::backend::MySQL&, std::_1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
Wt::Dbo::backend::MySQLStatement::~MySQLStatement() in MySQL.o
"_mysql_stmt_prepare", referenced from:
Wt::Dbo::backend::MySQLStatement::MySQLStatement(Wt::Dbo::backend::MySQL&, std::_1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
"_mysql_stmt_result_metadata", referenced from:
Wt::Dbo::backend::MySQLStatement::execute() in MySQL.o
"_mysql_stmt_store_result", referenced from:
Wt::Dbo::backend::MySQLStatement::execute() in MySQL.o
"_mysql_store_result", referenced from:
Wt::Dbo::backend::MySQL::executeSql(std::_1::basic_string<char, std::1::char_traits, std::_1::allocator > const&) in MySQL.o
Wt::Dbo::backend::MySQL::startTransaction() in MySQL.o
Wt::Dbo::backend::MySQL::commitTransaction() in MySQL.o
Wt::Dbo::backend::MySQL::rollbackTransaction() in MySQL.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: * [src/Wt/Dbo/backend/libwtdbomysql.3.3.3.dylib] Error 1
make[1]: * [src/Wt/Dbo/backend/CMakeFiles/wtdbomysql.dir/all] Error 2
make: * [all] Error 2
>
environments:
wt 3.3.3 or 3.3.4
boost 1.54 or 1.57
osx 10.9.4 64-bit
mysql-5.6.21-osx10.9-x86_64.dmg
cmake-2.8.12.2-Darwin64-universal.dmg
Apple LLVM 6.0
thread model posix
I referred this page :
http://redmine.webtoolkit.eu/projects/wt/wiki/Installing_Wt_on_Mac_OS_X_Lion
and set
MYSQL_LIBRARY = mysqlclient
MYSQL_INCLUDE = /usr/local/mysql/include
MYSQL_LIB = /usr/local/mysql/lib
MYSQL_PREFIX = /usr/local/mysql
and the cmake output
WARNING: Target "test.mysql" requests linking to directory "/usr/local/mysql/lib". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "wtdbomysql" requests linking to directory "/usr/local/mysql/lib". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "wtdbomysql" requests linking to directory "/usr/local/mysql/lib".
and it's okay when i disabled mysql.
so, I need some help to solve it.
Thanks!
Chainray
Updated by Chainray Hou about 10 years ago
Hi,
Sorry, I got it.
My leader solve this problem.
Must set MYSQL_LIB = /usr/local/mysql/libmysqlclient.dylb
Thanks!
Chainray