Earlier I used Mandriva when I where developing in C.
The program I try to compile is:
- Code: Select all
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "/usr/include/mysql/mysql.h"
#include "/usr/include/mysql/my_global.h"
#include "/usr/include/mysql/my_sys.h"
#include "/usr/include/mysql/my_config.h"
MYSQL my_connection;
MYSQL_RES *res_ptr;
MYSQL_ROW sqlrow;
main( int argc, char *argv[], char *envp[])
{
const char *userp = getenv("USER"); /* Vem är inloggad */
if (argc < 2)
{
fprintf( stderr, "Error: UserID saknas!\n");
exit(0);
}
else
{
fprintf( stdout, "UserID = %s\n", userp);
}
mysql_init(&my_connection);
}
I get this error:
[jan@humlan databas]$ cc bild-db.c -o bild-db
In file included from bild-db.c:10:0:
/usr/include/mysql/my_global.h:76:23: fatal error: my_config.h: File or directory does not exist
compiling interrupted.
[jan@humlan databas]$
I have checked that the file my_config.h exist in /usr/include/mysql as I have pointed to.
I have setup the following environment variable PATH as:
[jan@humlan databas]$ echo $PATH
/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin/:/usr/games:/usr/lib/qt4/bin:/home/jan/bin:/home/jan/Program/android-sdk-linux_86:/usr/local/mysql:/usr/include/mysql
[jan@humlan databas]$
As you can see the PATH point to the directory /usr/include/mysql
Does anyone know what I have forget to install/setup?