1) gcc via command prompt works; 2) via Xcode does NOT. Doesn't understand '_mysql_int'.
I got the following build error within Xcode 2.3 for a simple .c file:
[Session started at 2006-06-16 14:49:38 -0700.] ZeroLink: unknown symbol '_mysql_init'
mySQL has exited due to signal 6 (SIGABRT).
Why does ZeroLink doesn't know about '_mysql_int'? I believe I'm using the correct Xcode parameters based on the gcc command version.
Is there a particular Xcode parameter that I'm should (or should not) select?
Regards,
Ric.
------------------------------------------------------- // Sample.c
#include <stdio.h> #include <mysql.h>
int main (int argc, const char * argv[]) { // declare structures and varibles: MYSQL mysql; // Handle to database structure. MYSQL_RES *result = NULL; // Query Results. MYSQL_ROW row; // Array of counted byte-strings.
my_ulonglong numRows = 0;
// initialize MYSQL structure: mysql_init(&mysql); // Bombs out here.
mysql_close(&mysql);
fprintf(stdout,"End of Main()."); return 0; } // end main().
======================================= The following command from prompt works (compiles and links):
[/Users/Ric/Workarea]gcc sample.c -o sample.bin -I/usr/local/mysql/include -L/usr/local/mysql/lib -lmysqlclient -lz
------------------------------------------------------- Xcode settings:
OTHER_LDFLAGS = -lmysqlclient -lz LIBRARY_SEARCH_PATHS = /usr/local/mysql/lib HEADER_SEARCH_PATHS = /usr/local/mysql/include
|