MySQLTalk.org Forum Index MySQLTalk.org
MYSQL discussions groups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Header not found

 
Post new topic   Reply to topic    MySQLTalk.org Forum Index -> MySQL++
View previous topic :: View next topic  
Author Message
Andrea Giusto
Guest





PostPosted: Sun Apr 15, 2007 7:08 am    Post subject: Header not found Reply with 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
Jonathan Wakely
Guest





PostPosted: Mon Apr 16, 2007 3:43 am    Post subject: Re: Header not found Reply with quote



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






PostPosted: Mon Apr 16, 2007 8:49 pm    Post subject: RE: Header not found Reply with quote



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





PostPosted: Mon Apr 16, 2007 9:57 pm    Post subject: Re: Header not found Reply with quote

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:

Quote:
g++ -c test.cpp

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
Display posts from previous:   
Post new topic   Reply to topic    MySQLTalk.org Forum Index -> MySQL++ All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.