jeudi 12 janvier 2023

trying to compile static libmysqlcppconn8-static.a on Ubuntu 18.04.6 LTS

After looking ant trying all links on the web i just can't figure what is wrong. g++ version :

g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

This is my compilation line :

/usr/bin/g++ -fdiagnostics-color=always -Wall -std=c++11 -DSTATIC_CONCPP -I/home/vagrant/cpp/mysql-connector-cpp/include/ -I/home/vagrant/cpp/mysql-connector-cpp/include/mysqlx/ -I/home/vagrant/cpp/mysql-connector-cpp/common/ -I/home/vagrant/cpp/boost/ -I/home/vagrant/cpp/mysql-connector-cpp/build/cdk/protocol/mysqlx/protobuf -g /home/vagrant/cpp/mysql_conn_app/main.cpp /home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a -lssl -lcrypto -lpthread -lresolv -o /home/vagrant/cpp/mysql_conn_app/main.exe

This is the error:

/tmp/ccUnnhKN.o: In function `mysqlx::abi2::r0::string::traits<char>::from_str(mysqlx::abi2::r0::string&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/vagrant/cpp/mysql-connector-cpp/include/mysqlx/devapi/common.h:220: undefined reference to `mysqlx::abi2::r0::string::Impl::from_utf8(mysqlx::abi2::r0::string&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/ccUnnhKN.o: In function `mysqlx::abi2::r0::string::traits<char>::to_str[abi:cxx11](mysqlx::abi2::r0::string const&)':
/home/vagrant/cpp/mysql-connector-cpp/include/mysqlx/devapi/common.h:225: undefined reference to `mysqlx::abi2::r0::string::Impl::to_utf8[abi:cxx11](mysqlx::abi2::r0::string const&)'
/tmp/ccUnnhKN.o: In function `mysqlx::abi2::r0::SessionSettings::SessionSettings(mysqlx::abi2::r0::string const&)':
/home/vagrant/cpp/mysql-connector-cpp/include/mysqlx/devapi/settings.h:526: undefined reference to `mysqlx::abi2::r0::common::Settings_impl::set_from_uri(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::log_handler_init()':
./build/cdk/protocol/mysqlx/./cdk/protocol/mysqlx/protocol.cc:131: undefined reference to `google::protobuf::SetLogHandler(void (*)(google::protobuf::LogLevel, char const*, int, std::string const&))'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Protocol_server::snd_Ok(cdk::foundation::string const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx.pb.h:947: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Protocol_server::snd_Error(unsigned short, cdk::foundation::string 
....

what is wrong here ?

also when adding "-D_GLIBCXX_USE_CXX11_ABI=0" as suggested here: still not working

/usr/bin/g++ -fdiagnostics-color=always -Wall -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -DSTATIC_CONCPP -I/home/vagrant/cpp/mysql-connector-cpp/include/ -I/home/vagrant/cpp/mysql-connector-cpp/include/mysqlx/ -I/home/vagrant/cpp/mysql-connector-cpp/common/ -I/home/vagrant/cpp/boost/ -I/home/vagrant/cpp/mysql-connector-cpp/build/cdk/protocol/mysqlx/protobuf -g /home/vagrant/cpp/mysql_conn_app/main.cpp /home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a -lssl -lcrypto -lpthread -lresolv -o /home/vagrant/cpp/mysql_conn_app/main.exe

gives :

/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::log_handler_init()':
./build/cdk/protocol/mysqlx/./cdk/protocol/mysqlx/protocol.cc:131: undefined reference to `google::protobuf::SetLogHandler(void (*)(google::protobuf::LogLevel, char const*, int, std::string const&))'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Protocol_server::snd_Ok(cdk::foundation::string const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx.pb.h:947: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Protocol_server::snd_Error(unsigned short, cdk::foundation::string const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx.pb.h:1146: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Expr_builder_base::set_call(cdk::protocol::mysqlx::api::Db_obj const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx_expr.pb.h:2562: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'

adding protobuf + -D_GLIBCXX_USE_CXX11_ABI=0 same error:

 /usr/bin/g++ -fdiagnostics-color=always -Wall -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -DSTATIC_CONCPP -I/home/vagrant/cpp/mysql-connector-cpp/include/ -I/home/vagrant/cpp/mysql-connector-cpp/include/mysqlx/ -I/home/vagrant/cpp/mysql-connector-cpp/common/ -I/home/vagrant/cpp/boost/ -I/home/vagrant/cpp/mysql-connector-cpp/build/cdk/protocol/mysqlx/protobuf -g /home/vagrant/cpp/mysql_conn_app/main.cpp /home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a /home/vagrant/cpp/mysql-connector-cpp/build/cdk/protocol/mysqlx/protobuf/protobuf-3.19.4/cmake/libprotobufd.a /home/vagrant/cpp/mysql-connector-cpp/build/cdk/protocol/mysqlx/protobuf/protobuf-3.19.4/cmake/libprotobuf-lited.a /home/vagrant/cpp/mysql-connector-cpp/build/cdk/protocol/mysqlx/protobuf/protobuf-3.19.4/cmake/libprotocd.a -lssl -lcrypto -lpthread -lresolv -o /home/vagrant/cpp/mysql_conn_app/main.exe

gives :

/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::log_handler_init()':
./build/cdk/protocol/mysqlx/./cdk/protocol/mysqlx/protocol.cc:131: undefined reference to `google::protobuf::SetLogHandler(void (*)(google::protobuf::LogLevel, char const*, int, std::string const&))'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Protocol_server::snd_Ok(cdk::foundation::string const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx.pb.h:947: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Protocol_server::snd_Error(unsigned short, cdk::foundation::string const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx.pb.h:1146: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Expr_builder_base::set_call(cdk::protocol::mysqlx::api::Db_obj const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx_expr.pb.h:2562: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx_expr.pb.h:2631: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `cdk::protocol::mysqlx::Expr_builder_base::var(cdk::foundation::string const&)':
./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx_expr.pb.h:2013: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)'
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o):./build/cdk/protocol/mysqlx/./build/cdk/protocol/mysqlx/protobuf/mysqlx_expr.pb.h:2874: more undefined references to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*)' follow
/home/vagrant/cpp/mysql-connector-cpp/build/libmysqlcppconn8-static.a(libcdk_proto_mysqlx_protocol.cc.o): In function `void google::protobuf::internal::ArenaStringPtr::Set<google::protobuf::internal::ArenaStringPtr::EmptyDefault>(google::protobuf::internal::ArenaStringPtr::EmptyDefault, char const*, google::protobuf::Arena*)':
./build/cdk/protocol/mysqlx/./cdk/extra/protobuf/protobuf-3.19.4/src/google/protobuf/arenastring.h:200: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string const&, google::protobuf::Arena*)'

Aucun commentaire:

Enregistrer un commentaire