Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    1

    Unanswered: mysql C API compile error

    Hi,

    I'm trying to compile a C program on a new host and am getting the following error.

    undefined reference to strmov

    I'm compiling as follows

    gcc -o test test.c -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient -lz

    This worked on a previous host and I've checked that I have access to the /usr directories.

    I'm simply using strmov as follows within the C program.

    end = strmov(v_query,"SELECT count(*) FROM players");

    thanks in anticipation

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen
    Posts
    12

    Re: mysql C API compile error

    Hi,
    for anyone else encountering this error and hunting through the web unsuccessfully for a solution here is what I've done.

    I dumped strmov in favour of strcpy so that my code has changed from

    end = strmov(v_query, "SELECT count(*) ");
    end += mysql_escape_string(end,"FROM table",10);

    to

    end = strcpy(v_query, "SELECT count(*) ");
    end += strlen (end);
    end += mysql_escape_string(end,"FROM table",10);

    This works fine and at least the programs are now compiling.
    Calum
    www.4-3-3.com
    Online football Management Game

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •