hello all.
I install mysql  3.23.32 on  red hat 6.0  .
I have a c program source as bellow:
//*****************************************
//insert_test.c
#include <stdlib.h>
#include <stdio.h>
#include "mysql.h"

      int main(int argc, char *argv[]) {
         MYSQL my_connection;
         int res;
         mysql_init(&my_connection); 
         if (mysql_real_connect(&my_connection, "localhost","root", "", "nvod", 0, 
NULL, 0)) {
            printf("Connection success\n");
            res = mysql_query(&my_connection, "insert into task_log(task_id,content) 
values(111,'c programing')");
            if (!res) {
                   printf("Inserted %lu rows\n", (unsigned 
long)mysql_affected_rows(&my_connection));
            } else {
                   fprintf(stderr, "Insert error %d: 
s\n",mysql_errno(&my_connection),mysql_error(&my_connection));
            }
            mysql_close(&my_connection);
         } else {
            fprintf(stderr, "Connection failed\n");
            if (mysql_errno(&my_connection)) {
                fprintf(stderr, "Connection error %d: 
%s\n",mysql_errno(&my_connection),mysql_error(&my_connection));
            }
         }
         return EXIT_SUCCESS;
    }
//***************************************

I  use the bellow command to compile it:
gcc -I /usr/local/include/mysql mysql_test.c -L /usr/local/lib/mysql -lmysqlclient -lz 
-o mysql_test

It can be successful .but when I excute the result,it report error as:
/insert_test: error in loading shared libraries: libmysqlclient.so.6: cannot open 
shared object file: No such file or directory

Under the dirctory of /usr/local/lib/mysql ,I can see libmysqlclient.so.6.

How I solve it .Thanks .

            eagle
            [EMAIL PROTECTED]


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to