有关 MySQL 连接到 Netbeans(或其他 IDE)中的 C++ 应用程序的库的设置

发布时间:2021-03-04 18:07

当我想在 Netbeans IDE 中将 MySQL 连接到 C++ 应用程序时,我应该使用哪些库。我不断收到相同的错误消息。

undefined reference to `mysqlx::abi2::r0::string::Impl::to_utf8[abi:cxx11](mysqlx::abi2::r0::string const&)'

以下是我的内容

#include <iostream>
#include <stdint.h>
#include <windows.h>
#include <mysql.h>
#include <sys/types.h>
#include <C:\Program Files\MySQL\Connector C++ 8.0\include\mysqlx\xdevapi.h>

以下是我在netbeans中的设置netbeans compiler settings netbeans linker settings


如果有人在这方面有经验,知道要添加哪些库,请告诉我。

附加:我应该为 C 使用 JDBC 还是 XDevapi?


我使用的是 Windows 10、MinGW 编译器、Netbeans 11.1、C++ 8.0 的 MySQL 连接器

问候

回答1