MySQL Connect / C ++ 64位构建错误 [英] MySQL Connect/C++ 64 bit build error
问题描述
我使用Netbeans和MacoSX并安装了64位连接器。在构建我得到以下错误:
/ usr / bin / make -f nbproject / Makefile-Debug.mk SUBPROJECTS =。 build-conf
/ usr / bin / make -f nbproject / Makefile-Debug.mk dist / Debug / GNU-MacOSX / inventory
mkdir -p build / Debug / GNU-MacOSX
rm -f build / Debug / GNU-MacOSX / addproduct.od
g ++ -c -g -Iinclude -Iinclude -MMD -MP -MF build / Debug / GNU-MacOSX / addproduct.od -o build / Debug / GNU -MacOSX / addproduct.o从addproduct.cpp addproduct.cpp
:10:
在文件中从包括包括/ mysql_connection.h:30,
包含/ cppconn / connection.h:31: 29:warning:boost / variant.hpp:没有这样的文件或目录
在addproduct.cpp:10中包含的文件:
include / mysql_connection.h:31:32:warning:boost / shared_ptr.hpp :10:没有这样的文件或目录
从addproduct.cpp
在文件中从包括包括/ mysql_connection.h:30,
包含/ cppconn / connection.h:41:错误:助推尚未声明
包含/ cppconn / connection.h:41:错误:之前的预期初始化'<'令牌
包含/ cppconn / connection.h:43:错误:'ConnectPropertyVal被在此范围内
未声明包含/ cppconn / connection.h:43:错误:模板参数2无效
包含/ cppconn / connection.h:43:错误:模板参数4无效
:/ cppconn / connection.h:43:error:无效类型在声明前';'token
在addproduct.cpp中包含的文件:
include / mysql_connection.h:75: 'connectPropertyVal'不是'sql'的成员
include / mysql_connection.h:75:错误:'ConnectPropertyVal'不是'sql'的成员
include / mysql_connection.h:75:error:模板参数2无效
包括/ mysql_connection.h:75:错误:模板参数4无效
包含/ mysql_connection.h:157:错误:'ConnectPropertyVal'不是'SQL'$的成员b $ b包含/ mysql_connection.h:157:错误:'ConnectPropertyVal'不是'SQL'
的成员包括/ mysql_connection.h:157:错误:模板参数2无效
包含/ mysql_connection .H:157:错误:模板参数4无效
包含/ mysql_connection.h:160:错误:'助推'还没有被宣布
包含/ mysql_connection.h:160:错误:ISO C ++所禁止没有类型
的声明'shared_ptr'include / mysql_connection.h:160:error:expected';'before'<'token
make [2]:*** [build / Debug / GNU -MacOSX / addproduct.o]错误1
make [1]:*** [.build-conf]错误2
make:*** [.build-impl]错误2
BUILD FAILED(退出值2,总时间:538ms)
在Netbeans中,我链接 libmysqlcppconn .dylib 。
我缺少什么文件?
为什么要求BOOST?
mysql_connection.h包含 #include< boost /shared_ptr.hpp>
,您可以使用最新版本的boost或修改 mysql_connection.h
下面的代码来使用std :: shared_ptr: / p>
更新
#include< boost / shared_ptr.hpp>
boost :: shared_ptr< NativeAPI :: NativeConnectionWrapper>代理;
到
#include< memory>
std :: shared_ptr< NativeAPI :: NativeConnectionWrapper>代理;
I am using Netbeans and MacoSX and installed 64bit connector. On building I am getting following errors:
/usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
/usr/bin/make -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/inventory
mkdir -p build/Debug/GNU-MacOSX
rm -f build/Debug/GNU-MacOSX/addproduct.o.d
g++ -c -g -Iinclude -Iinclude -MMD -MP -MF build/Debug/GNU-MacOSX/addproduct.o.d -o build/Debug/GNU-MacOSX/addproduct.o addproduct.cpp
from addproduct.cpp:10:
In file included from include/mysql_connection.h:30,
include/cppconn/connection.h:31:29: warning: boost/variant.hpp: No such file or directory
In file included from addproduct.cpp:10:
include/mysql_connection.h:31:32: warning: boost/shared_ptr.hpp: No such file or directory
from addproduct.cpp:10:
In file included from include/mysql_connection.h:30,
include/cppconn/connection.h:41: error: 'boost' has not been declared
include/cppconn/connection.h:41: error: expected initializer before '<' token
include/cppconn/connection.h:43: error: 'ConnectPropertyVal' was not declared in this scope
include/cppconn/connection.h:43: error: template argument 2 is invalid
include/cppconn/connection.h:43: error: template argument 4 is invalid
include/cppconn/connection.h:43: error: invalid type in declaration before ';' token
In file included from addproduct.cpp:10:
include/mysql_connection.h:75: error: 'ConnectPropertyVal' is not a member of 'sql'
include/mysql_connection.h:75: error: 'ConnectPropertyVal' is not a member of 'sql'
include/mysql_connection.h:75: error: template argument 2 is invalid
include/mysql_connection.h:75: error: template argument 4 is invalid
include/mysql_connection.h:157: error: 'ConnectPropertyVal' is not a member of 'sql'
include/mysql_connection.h:157: error: 'ConnectPropertyVal' is not a member of 'sql'
include/mysql_connection.h:157: error: template argument 2 is invalid
include/mysql_connection.h:157: error: template argument 4 is invalid
include/mysql_connection.h:160: error: 'boost' has not been declared
include/mysql_connection.h:160: error: ISO C++ forbids declaration of 'shared_ptr' with no type
include/mysql_connection.h:160: error: expected ';' before '<' token
make[2]: *** [build/Debug/GNU-MacOSX/addproduct.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 538ms)
In Netbeans I am linking libmysqlcppconn.dylib only.
What files am I missing? Why is it asking for BOOST? and which Boost Libs do I need to install?
mysql_connection.h includes #include <boost/shared_ptr.hpp>
, you could either use latest versions of boost or modify below lines mysql_connection.h
to use std::shared_ptr instead:
update
#include <boost/shared_ptr.hpp>
boost::shared_ptr< NativeAPI::NativeConnectionWrapper > proxy;
to
#include <memory>
std::shared_ptr< NativeAPI::NativeConnectionWrapper > proxy;
这篇关于MySQL Connect / C ++ 64位构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!