If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > mysql C API compile error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-19-04, 14:56
calum433b calum433b is offline
Registered User
 
Join Date: Apr 2004
Posts: 1
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
Reply With Quote
  #2 (permalink)  
Old 04-21-04, 04:18
calum433 calum433 is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On