Hello fellows:
I am spending some hours to enable and run properly a mysql client linked to a centos server (no problem to accomplish the tasks with it, even running with command for compilation
mysql_config --libs
mysql_config --cflags
#gcc -o <filebin> $(mysql_config --cflags) <main.c> $(mysql_config --libs)
). actually i have a little program to look for data (select, etc.) I am developing with codeblocks and have done the next>
tc@box: tce-load -i mysql-client
tc@box: tce-load -i mysql-dev
also configured codeblocks with setting>compiler & debuger:
link libraries: /usr/local/mysql/lib/libmysqlclient.so
search directories : /usr/local/mysql/include
C program in codeblocks:
#include <stdlib.h>
#include <stdio.h>
#include <mysql.h>
.
.
MYSQL *conn;
MYSQL_RES *res;
MYSQL_ROW row;
char *server = "ipaddress";
char *user = "databaseuser";
char *password = "passworddatabase";
char *database = "database";
int main(void)
{
conn = mysql_init(NULL);
if (mysql_real_connect(conn, server,
user, password, database, 0, NULL, CLIENT_MULTI_STATEMENTS) == 0x00)
{
fprintf(stderr, "%s\n", mysql_error(conn));
exit(1);
}
if (mysql_query(conn, "SELECT * FROM ORDENES; SELECT * EMPLEADOS;"))
{
fprintf(stderr, "%s\n", mysql_error(conn));
exit(1);
}
<more code>
}
After compilation, no errors are reported and exist an executable program.
Either runnig in codeblocks or in a terminal, the next message appears:
/home/tc/MIBM_CLIENTE/bin/Debug/MIBM_CLIENTE: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
Process returned 127 (0x7F) execution time : 0.011 s
Press ENTER to continue.
I have entered deeply in the google search and in the actual forum with no other similar post.
If I do the procedure as with centos, the scripts and gcc commands return messages as:
tc@box:~/MIBM_CLIENTE$ mysql_config --libs
sh: mysql_config: not found
tc@box:~/MIBM_CLIENTE$ mysql_config --cflags
sh: mysql_config: not found
tc@box:~/MIBM_CLIENTE$ gcc -o <filebin> $(mysql_config --cflags) <main.c> $(mysq
l_config --libs)
sh: mysql_config: not found
sh: mysql_config: not found
sh: can't open filebin: no such file
tc@box:~/MIBM_CLIENTE$
tc@box:~/MIBM_CLIENTE$
Maybe the procedure to enable mysql in tiny core is completely different.
Does any body has a hint?
Regards,
blackdiamond