g++ -I/usr/include/mysql -L/usr/include/mysql -L/usr/local/include
-I/usr/local/include -lmysqlclient box.c -o box
on this code:
#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>
#include "mysql++.h"
#include "connection.h"
using namespace std;
int main(int argc, char *argv[])
{
mysqlpp::Connection db(mysqlpp::use_exceptions);
return (0);
}
Returns this error
/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
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.
Help!
Josh