xdevapi.h can't pass compile
Today,i find my code can't pass compile,and my computer environment is mingw64(It's installed by msys2)+MySQL8.0.15+mysql-connector-c++-8.0.15-winx64.zip.
I copy the 'include' folder to C:\msys64\mingw64\include\mysql.And having the code as follows:
```c++
#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 www.baidu.com and offical document.
Someone could help me.I'd appreciate with you.
Subject
Views
Written By
Posted
xdevapi.h can't pass compile
2320
February 23, 2019 07:21AM
1086
February 25, 2019 04:25AM
999
February 25, 2019 09:44AM
771
February 25, 2019 11:19AM
721
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.