MySQL Forums
Forum List  »  Connector/C++

xdevapi.h can't pass compile
Posted by: longtao zhang
Date: February 23, 2019 07:21AM

Today,i find my code can't pass compile,and my computer environment is mingw64(It's installed by msys2)
I copy the 'include' folder to C:\msys64\mingw64\include\mysql.And having the code as follows:
#include <iostream>
#include <mysql/mysqlx/xdevapi.h>

int msin(){
return 0;
Howerer,the code can't pass compile.The compile message as follows:
[ 50%] Building CXX object CMakeFiles/uhelloworld.dir/main.cpp.obj
[100%] Linking CXX executable uhelloworld.exe
CMakeFiles\uhelloworld.dir/objects.a(main.cpp.obj): In function `mysqlx::string::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const':
C:/msys64/mingw64/include/mysql/mysqlx/devapi/common.h:115: undefined reference to `mysqlx::string::Impl::to_utf8[abi:cxx11](mysqlx::string const&)'
CMakeFiles\uhelloworld.dir/objects.a(main.cpp.obj): In function `mysqlx::Value::print(std::ostream&) const':
C:/msys64/mingw64/include/mysql/mysqlx/devapi/document.h:507: undefined reference to `mysqlx::common::Value::print(std::ostream&) const'
CMakeFiles\uhelloworld.dir/objects.a(main.cpp.obj):main.cpp:(.rdata$_ZTCN6mysqlx5ValueE0_NS_6common5ValueE[_ZTCN6mysqlx5ValueE0_NS_6common5ValueE]+0x20): undefined reference to `mysqlx::common::Value::print(std::ostream&) const'
CMakeFiles\uhelloworld.dir/objects.a(main.cpp.obj):main.cpp:(.rdata$.refptr._ZTVN6mysqlx5DbDocE[.refptr._ZTVN6mysqlx5DbDocE]+0x0): undefined reference to `vtable for mysqlx::DbDoc'
collect2.exe: error: ld returned 1 exit status
I can't solve this problem through and offical document.
Someone could help me.I'd appreciate with you.

Options: ReplyQuote

Written By
xdevapi.h can't pass compile
February 23, 2019 07:21AM
February 25, 2019 04:25AM
February 25, 2019 09:44AM
February 25, 2019 11:19AM
February 26, 2019 09:12AM

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.