 |
MySQLTalk.org MYSQL discussions groups
|
| View previous topic :: View next topic |
| Author |
Message |
Andrea Giusto Guest
|
Posted: Sun Apr 15, 2007 7:08 am Post subject: Header not found |
|
|
Hi
I am a total newbie to SQL! I use debian, I have installed the library,
everything is fine except that the following code won't compile
#include <mysql++.h>
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
mysqlpp::Connection con(false);
if(!connect_to_db(argc,argv,con)){
return 1;
}
mysqlpp::Query query = con.query();
query << "create table foo( foo int )";
return 0;
}
when I try to g++ it I receive
main.cpp:1:21: error: mysql++.h: No such file or directory
main.cpp: In function ‘int main(int, char**)’:
main.cpp:11: error: ‘mysqlpp’ has not been declared
main.cpp:11: error: expected `;' before ‘con’
etc...
I checked, the header file is there, I also tried the -L option of g++. Also
the examples won't compile issuing the same error...please help!!! |
|
| Back to top |
|
 |
Jonathan Wakely Guest
|
Posted: Mon Apr 16, 2007 3:43 am Post subject: Re: Header not found |
|
|
On 15/04/07, Andrea Giusto <giusto (AT) uoregon (DOT) edu> wrote:
| Quote: | I checked, the header file is there, I also tried the -L option of g++. Also
the examples won't compile issuing the same error...please help!!!
|
Try -I not -L
Jon |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Apr 16, 2007 8:49 pm Post subject: RE: Header not found |
|
|
Andrea,
You need to point the compiler at the mysql++ include directory. If you
configured mysql++ with "--prefix=/usr/local", then the -I argument for
the compiler would be "-I /usr/local/include/mysql++".
Reid
-----Original Message-----
From: Andrea Giusto [mailto:giusto (AT) uoregon (DOT) edu]
Sent: Saturday, April 14, 2007 9:08 PM
To: plusplus (AT) lists (DOT) mysql.com
Subject: Header not found
Hi
I am a total newbie to SQL! I use debian, I have installed the library,
everything is fine except that the following code won't compile
#include <mysql++.h>
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
mysqlpp::Connection con(false);
if(!connect_to_db(argc,argv,con)){
return 1;
}
mysqlpp::Query query = con.query();
query << "create table foo( foo int )";
return 0;
}
when I try to g++ it I receive
main.cpp:1:21: error: mysql++.h: No such file or directory
main.cpp: In function 'int main(int, char**)':
main.cpp:11: error: 'mysqlpp' has not been declared
main.cpp:11: error: expected `;' before 'con'
etc...
I checked, the header file is there, I also tried the -L option of g++.
Also the examples won't compile issuing the same error...please help!!!
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:
http://lists.mysql.com/plusplus?unsub=reid.madsen (AT) tek (DOT) com |
|
| Back to top |
|
 |
Kaplenko Vitalij Guest
|
Posted: Mon Apr 16, 2007 9:57 pm Post subject: Re: Header not found |
|
|
Hi!
For first try to compile this one:
---------------------------------
test.cpp:
#include <mysql++.h>
int main(int argc, char *argv[])
{
return 0;
}
---------------------------------
If you try like this:
You recive:
test.cpp:27:21: error: mysql++.h: No such file or directory
If you try like this:
| Quote: | g++ -c -I/usr/local/include/mysql++ -I/usr/include/mysql test.cpp
|
It will be Ok and you'l got "test.o"-file.
Andrea Giusto wrote:
| Quote: | Hi
I am a total newbie to SQL! I use debian, I have installed the library,
everything is fine except that the following code won't compile
#include <mysql++.h
#include <iostream
#include <iomanip
#include <string
using namespace std;
int main(int argc, char *argv[])
{
mysqlpp::Connection con(false);
if(!connect_to_db(argc,argv,con)){
return 1;
}
mysqlpp::Query query = con.query();
query << "create table foo( foo int )";
return 0;
}
when I try to g++ it I receive
main.cpp:1:21: error: mysql++.h: No such file or directory
main.cpp: In function ‘int main(int, char**)’:
main.cpp:11: error: ‘mysqlpp’ has not been declared
main.cpp:11: error: expected `;' before ‘con’
etc...
I checked, the header file is there, I also tried the -L option of g++. Also
the examples won't compile issuing the same error...please help!!!
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|