2013-01-19 58 views
0

我正在使用Netbeans和MacoSX并安装了64位连接器。在建设我收到以下错误:MySQL连接/ C++ 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.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) 

在NetBeans我联libmysqlcppconn.dylib只。

我错过了哪些文件? 为什么要求升压?以及哪些Boost Libs需要安装?

回答

1

mysql_connection.h包括#include <boost/shared_ptr.hpp>,你既可以使用增强的最新版本或修改以下行mysql_connection.h使用std :: shared_ptr的,而不是:

更新

#include <boost/shared_ptr.hpp> 
boost::shared_ptr<NativeAPI::NativeConnectionWrapper> proxy; 

#include <memory> 
std::shared_ptr<NativeAPI::NativeConnectionWrapper> proxy; 
+0

线* STD :: shared_ptr的代理; *它说:* *无法解析标识符shared_ptr ** – Volatil3

+0

也许您需要'#包括','std :: tr1 :: shared_ptr'如果您的编译器不是最新版本 – billz

+0

仍然相同的标识符错误:(我在MacOsX 10.6 – Volatil3