Home > Archive > MySQL ODBC Connector > January 2006 > path problem compiling mysql c program









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author path problem compiling mysql c program
Nooby

2006-01-26, 4:56 pm

I have a basic c mysql program runing on unix that has a path problem
when compiling with gcc... The libraries are in place. The 'set' tells
me my path is set. But the compiler keeps not finding the library....
Any help greatly appreciated.

This is the program (abridged):
#include "mysql.h"
#include <stdio.h>

main() {
MYSQL *conn;
MYSQL_RES *res;
MYSQL_ROW row;

char *server = "localhost";
....
/* Release memory used to store results and close connection */
mysql_free_result(re
s);
mysql_close(conn);
}

This is my path (from set)
PATH=/usr/bin:
/usr/ucb:
/etc:
/usr/local/bin:
/bin:
/usr/local/mysql5016/lib/mysql:
/usr/local/mysql5016/include:
/usr/local/mysql5016/include/mysql:
/opt/local/bin

This is the location of library
/usr/local/mysql5016/include/mysql/mysql.h

This is my response everytime I try to compile:
gcc mysql_test.c -o mysql_test
mysql_test.c:1: mysql.h: No such file or directory

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com