dbTalk Databases Forums  

Undefined reference to Connection object....

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Undefined reference to Connection object.... in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Josh Bigelow
 
Posts: n/a

Default Undefined reference to Connection object.... - 08-20-2005 , 02:17 PM






------_=_NextPart_001_01C5A5BB.83A13CE5
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

g++ -I/usr/include/mysql -L/usr/include/mysql -L/usr/local/include
-I/usr/local/include -lmysqlclient box.c -o box

=20

on this code:

=20

#include <sys/types.h>

#include <sys/socket.h>

#include <netinet/in.h>

#include <arpa/inet.h>

#include <netdb.h>

#include <unistd.h>

#include <signal.h>

#include <stdio.h>

#include <fcntl.h>

#include <errno.h>

#include <sys/time.h>

#include <stdlib.h>

#include <memory.h>

#include <errno.h>

#include <mysql/mysql.h>

#include <iostream>

#include <iomanip>

=20

#include "mysql++.h"

#include "connection.h"

=20

=20

using namespace std;

=20

int main(int argc, char *argv[])

{

mysqlpp::Connection db(mysqlpp::use_exceptions);

return (0);

=20

}

=20

Returns this error

=20

/tmp/ccDdQ32L.o(.text+0x20): In function `main':

: undefined reference to `mysqlpp::Connection::Connection(bool)'

/tmp/ccDdQ32L.o(.text+0x32): In function `main':

: undefined reference to `mysqlpp::Connection::~Connection()'

collect2: ld returned 1 exit status

=20

Ignore all the other includes they are for some socket programming that
is another part of this program...I know that mysql++.h and connection.h
are in /usr/local/include, and I cannot figure out why it's doing this
when these function references are clearly there.

=20

Help!

Josh

=20


------_=_NextPart_001_01C5A5BB.83A13CE5--

Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: Undefined reference to Connection object.... - 08-22-2005 , 05:20 PM






Josh Bigelow wrote:
Quote:
g++ -I/usr/include/mysql -L/usr/include/mysql -L/usr/local/include
-I/usr/local/include -lmysqlclient box.c -o box
You're failing to link to the MySQL++ library. Add -lmysqlpp

Quote:
#include "connection.h"
You don't need to add that.

Quote:
I know that mysql++.h and connection.h
are in /usr/local/include, and I cannot figure out why it's doing this
when these function references are clearly there.
If this were your problem, you'd get a different error.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.