Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ MySQL-Connect/C++;64位生成错误_C++_Mysql_Netbeans_Mysql Connector - Fatal编程技术网

C++ MySQL-Connect/C++;64位生成错误

C++ MySQL-Connect/C++;64位生成错误,c++,mysql,netbeans,mysql-connector,C++,Mysql,Netbeans,Mysql Connector,我正在使用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-M

我正在使用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.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)
/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/gnumacosx
rm-f build/Debug/gnumacosx/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
来自addproduct.cpp:10:
在include/mysql_connection.h:30中包含的文件中,
include/cppcon/connection.h:31:29:警告:boost/variant.hpp:没有这样的文件或目录
在addproduct.cpp中包含的文件中:10:
include/mysql_connection.h:31:32:警告:boost/shared_ptr.hpp:没有这样的文件或目录
来自addproduct.cpp:10:
在include/mysql_connection.h:30中包含的文件中,
include/cppcon/connection.h:41:错误:“boost”尚未声明

include/cppcon/connection.h:41:错误:在“之前应该是初始值设定项。您是否阅读了名为”的文档?仔细阅读整个页面,然后查找特定于MacOSX的链接…

mysql\u connection.h includes
\35; includes
,您可以使用最新版本的boost或修改以下行
mysql\u connection.h
以使用std::shared\u ptr:

更新

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

#包括
std::shared_ptrproxy;

联机std::shared\u ptr代理;它说:无法解析标识符共享\u ptr因为您需要
#include
std::tr1::shared\u ptr
如果您的编译器不是最新版本,请告诉我Boost是通过Macport安装的,但没有链接到NEtbeans项目中。。我无法找到所需的LibI不知道Netbeans,但只是添加了-I include path和-L link path您是对的。。我试图包括安装Boost的路径。但我很好奇为什么它没有加载本机内存头文件?
#include <memory>
std::shared_ptr< NativeAPI::NativeConnectionWrapper > proxy;