gpt4 book ai didi

mysql - 无法编译 MySQL++

转载 作者:行者123 更新时间:2023-11-29 00:49:58 26 4
gpt4 key购买 nike

我正在尝试编译 MySQL++ 3.1.0使用命令:

mingw32-make -f Makefile.mingw

编译一组文件(例如 beemutex.cpp、cmdline.cpp、connection.cpp 等)后,我收到以下错误:

g++ -c -o mysqlpp_sql_buffer.o -g -mthreads -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -DHAVE_MYSQL_SSL_SET -I"C:\Program Files\MySQL\MySQL Server 5.5\include"   -MT
mysqlpp_sql_buffer.o -MFmysqlpp_sql_buffer.o.d -MD -MP lib/sql_buffer.cpp
In file included from lib/sql_buffer.h:31:0,
from lib/sql_buffer.cpp:26:
lib/refcounted.h:258:2: error: 'size_t' does not name a type
lib/refcounted.h: In constructor 'mysqlpp::RefCountedPointer<T, Destroyer>::RefCountedPointer()':
lib/refcounted.h:89:2: error: class 'mysqlpp::RefCountedPointer<T, Destroyer>' does not have any field named 'refs_'
lib/refcounted.h: In constructor 'mysqlpp::RefCountedPointer<T, Destroyer>::RefCountedPointer(T*)':
lib/refcounted.h:100:2: error: class 'mysqlpp::RefCountedPointer<T, Destroyer>' does not have any field named 'refs_'
lib/refcounted.h:104:4: error: 'refs_' was not declared in this scope
lib/refcounted.h:104:16: error: expected type-specifier before 'size_t'
lib/refcounted.h:104:16: error: expected ';' before 'size_t'
lib/refcounted.h: In constructor 'mysqlpp::RefCountedPointer<T, Destroyer>::RefCountedPointer(const ThisType&)':
lib/refcounted.h:112:2: error: class 'mysqlpp::RefCountedPointer<T, Destroyer>' does not have any field named 'refs_'
lib/refcounted.h:115:8: error: 'refs_' was not declared in this scope
lib/refcounted.h: In destructor 'mysqlpp::RefCountedPointer<T, Destroyer>::~RefCountedPointer()':
lib/refcounted.h:125:7: error: 'refs_' was not declared in this scope
lib/refcounted.h: In member function 'void mysqlpp::RefCountedPointer<T, Destroyer>::swap(mysqlpp::RefCountedPointer<T, Destroyer>::ThisType&)':
lib/refcounted.h:246:13: error: 'refs_' was not declared in this scope
mingw32-make: *** [mysqlpp_sql_buffer.o] Error 1

我的配置可能有问题,但我找不到是什么。它找不到例如 size_t 似乎很奇怪。

谢谢!

平台:
Windows 7
MinGW 2011.09/GCC 4.6.1
MySQL 5.5
mysql++ 3.1.0

最佳答案

refcounted.h 中用 std::size_t() 更改 size_t() 解决了这个问题。它现在编译。

我仍然有链接问题,但它们应该是不同的问题。

关于mysql - 无法编译 MySQL++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8976265/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com