Hi all,
I'd like to write a mysql client with mingw. It compiles without problems but if I try to run the app I get an error message which says somthing like (free translation from german):
Entry point for [EMAIL PROTECTED] function not found in libmySQL.dll.


What I've done so far:
cd into the mysql lib/opt
$ reimp -d libmySQL.lib
$ dlltool.exe --input-def LIBMYSQL.def --dllname libmySQL.dll --output-lib libmysql.a
$ mv libmysql.a /c/mingw/lib
(I use a cygwin bash shell)


The compiling kommand:
gcc mysql-test.c -omysql-test.exe -IC:\Programme\mysql\include -lmysql

The code:
#include <stdio.h>
#include <windows.h>
#include <mysql.h>

int main() {
  MYSQL *db;
  MYSQL_RES *rsltSet;
  MYSQL_ROW row;
  db = mysql_init(NULL);
  unsigned int num_fields, i;
  if (!mysql_real_connect(db, "host", "usr", "pwd", "db",
                          0, NULL, 0)) {
    printf("Verbindungs-Aufbau-Fehler: %s\n", mysql_error(db));
    return 1;
  }
  printf ("Verbindung aufgebaut\n");
  if (!mysql_query(db, "show tables;")) {
    printf("SQL-Fehler: %s\n", mysql_error(db));
    return 1;
  }
  printf("SQL-Abgesetzt\n");
  rsltSet = mysql_use_result(db);
  num_fields = mysql_num_fields(rsltSet);
  while ((row = mysql_fetch_row(rsltSet))) {
    unsigned long *lengths;
    lengths = mysql_fetch_lengths(rsltSet);
    for (i=0; i<num_fields; i++) {
      printf("[%.*s] ", (int) lengths[i], row[i] ? row[i] : "NULL");
    }
    printf("\n");
    }
  mysql_close(db);
  return 0;
}

OS: XP
mysql version: 4.0.14, for Win95/Win98 (i32)

Thank you for your time and help
Stephan


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to