MySQL Forums
Forum List  »  Source, Builds, Binaries

Re: compiling problems
Posted by: xu leit
Date: February 08, 2006 10:02PM

I meet the same problem with "mysql++ 1.7.26, mysql 4.1 on Gentoo Linux".
when I compile my cpp file with:
# g++ simple.cpp
It will complain "mysql++.h: No such file or directory "

when I compile my program with:
#g++ simple.cpp -I/usr/include/mysql++
It will complain "mysql.h: No such file or directory"

//-----begin simple.cpp-------
#include <mysql++.h>
#include <iostream>
#include <iomanip>

using namespace mysqlpp;
using namespace std;

int main()
{
mysqlpp::Connection con(false);
return 0;
}
//-----end simple.cpp-------


"mysql++.h" and "mysql.h" are already on my machine.
office112 mysql++ # locate mysql++.h
/usr/include/mysql++/mysql++.h
/usr/include/mysql++/mysql++.hh

office112 mysql++ # locate mysql.h
/usr/share/doc/courier-authlib-0.57-r1/html/README.authmysql.html
/usr/include/mysql/mysql.h

# g++ simple.cpp -I/usr/include/mysql++ -I/usr/include/mysql
It will complain "undefined reference to `mysqlpp::Connection::~Connection [in-charge]()'"

office112 mysql++ # g++ simple.cpp -I/usr/include/mysql++ -I/usr/include/mysql
/tmp/ccAPPcAa.o(.text+0x33): In function `main':
: undefined reference to `mysqlpp::Connection::~Connection [in-charge]()'
/tmp/ccAPPcAa.o(.gnu.linkonce.t._ZN7mysqlpp10ConnectionC1Eb+0x3d): In function `mysqlpp::Connection::Connection[in-charge](bool)':
: undefined reference to `mysql_init'
collect2: ld returned 1 exit status



office112 mysql++ # g++ simple.cpp -I/usr/include/mysql++
In file included from /usr/include/mysql++/mysql++.h:3,
from simple.cpp:1:
/usr/include/mysql++/defs.h:6:19: mysql.h: No such file or directory
In file included from /usr/include/mysql++/mysql++.h:3,
from simple.cpp:1:
/usr/include/mysql++/defs.h:21: error: syntax error before `;' token
In file included from /usr/include/mysql++/coldata.h:12,
from /usr/include/mysql++/mysql++.h:5,
from simple.cpp:1:
/usr/include/mysql++/type_info.h:6:19: mysql.h: No such file or directory
In file included from /usr/include/mysql++/coldata.h:12,
from /usr/include/mysql++/mysql++.h:5,
from simple.cpp:1:
/usr/include/mysql++/type_info.h:71: error: `enum_field_types' was not declared
in this scope
/usr/include/mysql++/type_info.h:71: error: parse error before `,' token
/usr/include/mysql++/type_info.h:85: error: parse error before `t'
/usr/include/mysql++/type_info.h:88: error: parse error before `&' token
/usr/include/mysql++/type_info.h:164: error: parse error before `t'
/usr/include/mysql++/type_info.h:170: error: parse error before `&' token
/usr/include/mysql++/type_info.h:175: error: ISO C++ forbids declaration of `
_length' with no type
/usr/include/mysql++/type_info.h:175: error: `int
mysqlpp::mysql_type_info::_length' is not a static member of `class
mysqlpp::mysql_type_info'
/usr/include/mysql++/type_info.h:175: error: `f' was not declared in this scope
/usr/include/mysql++/type_info.h:176: error: ISO C++ forbids declaration of `
_max_length' with no type
/usr/include/mysql++/type_info.h:176: error: `int
mysqlpp::mysql_type_info::_max_length' is not a static member of `class
mysqlpp::mysql_type_info'
/usr/include/mysql++/type_info.h:176: error: `f' was not declared in this scope
/usr/include/mysql++/type_info.h:177: error: parse error before `}' token
/usr/include/mysql++/type_info.h:182: confused by earlier errors, bailing out

Options: ReplyQuote


Subject
Views
Written By
Posted
5043
November 17, 2005 01:16PM
3046
November 21, 2005 01:36AM
2956
November 21, 2005 10:49AM
Re: compiling problems
7552
February 08, 2006 10:02PM
4058
February 09, 2006 11:04PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.