MySQL Forums
Forum List  »  Connector/C++

I need help with a build of mysql connector 8 test code which fails with symbols not found for architecture x86-64.
Posted by: Timothy Cerka
Date: December 29, 2019 02:34PM

This is the code that is to be compiled:

#include <iostream>
#include <mysqlx/xdevapi.h>

using namespace mysqlx;

string usr = "root";
string pwd = “password”;

int main()
{
Session mySession(SessionOption::HOST, "localhost",
SessionOption::PORT, 33060,
SessionOption::USER, usr,
SessionOption::PWD, pwd);

return 0;
}



The following is the output from the build console:


12:51:32 **** Incremental Build of configuration Debug for project SQL_Test_1 ****
make all
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -std=c++0x -I/repository_source_code/openssl/openssl-1.0.2u/include -I/repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include -I/repository_source_code/boost/boost_1_72_0/boost -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.o" -o "main.o" "../main.cpp"
In file included from ../main.cpp:2:
In file included from /repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/xdevapi.h:93:
In file included from /repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/devapi/common.h:35:
In file included from /repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/devapi/../common.h:46:
In file included from /repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/common/error.h:40:
/repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/common/util.h:339:10: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
return std::move(uc_val);
^
/repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/common/util.h:339:10: note: remove std::move call here
return std::move(uc_val);
^~~~~~~~~~ ~
/repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/common/util.h:350:10: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
return std::move(uc_val);
^
/repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/include/mysqlx/common/util.h:350:10: note: remove std::move call here
return std::move(uc_val);
^~~~~~~~~~ ~
2 warnings generated.
Finished building: ../main.cpp

Building target: SQL_Test_1
Invoking: MacOS X C++ Linker
g++ -L/repository_source_code/mysql/connector/mysql-connector-cpp-8.0.18/mysql-connector-cpp-8.0.18/lib64 -o "SQL_Test_1" ./main.o
Undefined symbols for architecture x86_64:
"mysqlx::abi2::r0::common::Settings_impl::Data::init_connection_attr()", referenced from:
mysqlx::abi2::r0::common::Settings_impl::Data::Data() in main.o
"mysqlx::abi2::r0::string::Impl::to_utf8(mysqlx::abi2::r0::string const&)", referenced from:
mysqlx::abi2::r0::string::traits<char>::to_str(mysqlx::abi2::r0::string const&) in main.o
"mysqlx::abi2::r0::string::Impl::from_utf8(mysqlx::abi2::r0::string&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
mysqlx::abi2::r0::string::traits<char>::from_str(mysqlx::abi2::r0::string&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in main.o
"mysqlx::abi2::r0::internal::Session_detail::close()", referenced from:
mysqlx::abi2::r0::internal::Session_detail::~Session_detail() in main.o
"mysqlx::abi2::r0::internal::Session_detail::Session_detail(mysqlx::abi2::r0::common::Settings_impl&)", referenced from:
mysqlx::abi2::r0::Session::Session(mysqlx::abi2::r0::SessionSettings) in main.o
"mysqlx::abi2::r0::internal::Settings_detail<mysqlx::abi2::r0::internal::Settings_traits>::do_set(std::__1::list<std::__1::pair<int, mysqlx::abi2::r0::common::Value>, std::__1::allocator<std::__1::pair<int, mysqlx::abi2::r0::common::Value> > >&&)", referenced from:
void mysqlx::abi2::r0::internal::Settings_detail<mysqlx::abi2::r0::internal::Settings_traits>::set<true, mysqlx::abi2::r0::SessionOption::Enum, char const*&, mysqlx::abi2::r0::SessionOption::Enum&, int&, mysqlx::abi2::r0::SessionOption::Enum&, mysqlx::abi2::r0::string&, mysqlx::abi2::r0::SessionOption::Enum&, mysqlx::abi2::r0::string&>(mysqlx::abi2::r0::SessionOption::Enum, char const*&&&, mysqlx::abi2::r0::SessionOption::Enum&&&, int&&&, mysqlx::abi2::r0::SessionOption::Enum&&&, mysqlx::abi2::r0::string&&&, mysqlx::abi2::r0::SessionOption::Enum&&&, mysqlx::abi2::r0::string&&&) in main.o
"mysqlx::abi2::r0::common::Value::print(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const", referenced from:
mysqlx::abi2::r0::Value::print(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
construction vtable for mysqlx::abi2::r0::common::Value-in-mysqlx::abi2::r0::Value in main.o
"typeinfo for mysqlx::abi2::r0::common::Value", referenced from:
construction vtable for mysqlx::abi2::r0::common::Value-in-mysqlx::abi2::r0::Value in main.o
typeinfo for mysqlx::abi2::r0::Value in main.o
"VTT for mysqlx::abi2::r0::common::Value", referenced from:
mysqlx::abi2::r0::common::Value::~Value() in main.o
"vtable for mysqlx::abi2::r0::DbDoc", referenced from:
mysqlx::abi2::r0::DbDoc::~DbDoc() in main.o
mysqlx::abi2::r0::DbDoc::DbDoc() in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for mysqlx::abi2::r0::common::Value", referenced from:
mysqlx::abi2::r0::common::Value::Value(std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> > const&) in main.o
mysqlx::abi2::r0::common::Value::Value(long long) in main.o
mysqlx::abi2::r0::common::Value::Value(mysqlx::abi2::r0::common::Value&&) in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [SQL_Test_1] Error 1

12:51:33 Build Finished (took 1s.299ms)

From the looks of this output it seems that there are 10 undefined symbols. Can anybody help interpret this output?

With Thanks

Tim Cerka

Mac Mini 2.5 GHz Intel Core i5
macOS Sierra v10.12.6

Eclipse IDE for C/C++ Developers
Version: Mars.1 Release (4.5.1)

Options: ReplyQuote


Subject
Views
Written By
Posted
I need help with a build of mysql connector 8 test code which fails with symbols not found for architecture x86-64.
2126
December 29, 2019 02:34PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.