0

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?

Volatil3
  • 14,253
  • 38
  • 134
  • 263

2 Answers2

1

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;
billz
  • 44,644
  • 9
  • 83
  • 100
  • On line *std::shared_ptr< NativeAPI::NativeConnectionWrapper > proxy;* it says: **Unable to resolve identifier shared_ptr** – Volatil3 Jan 19 '13 at 04:58
  • maybe you need `#include `, `std::tr1::shared_ptr` if your compiler is not latest version – billz Jan 19 '13 at 04:59
  • Let me tell you that Boost is installed via Macport but *NOT* linked in NEtbeans Project.. I am unable to locate the required Lib – Volatil3 Jan 19 '13 at 05:02
  • I don't know Netbeans, but it's just to add -I include path and -L link path – billz Jan 19 '13 at 05:03
  • You're right.. I am trying to include path where Boost is installed. But I am curious why it did not load up native memory header file? – Volatil3 Jan 19 '13 at 05:06
  • `g++ -c -g -Iinclude -Iinclude` maybe no right? could try absolute path first – billz Jan 19 '13 at 05:07
  • You rock Bro! it worked! all I had to include *Boost* from **/opt/local/include** – Volatil3 Jan 19 '13 at 05:55
0

Have you read the documentation entitled "21.4.2. Installing MySQL Connector/C++ from Source"? Read the entire page carefully, then look for links specific to MacOSX...

autistic
  • 1
  • 3
  • 35
  • 80