I was trying to establish connection to MySQL through a simple C program using it's C API mysqL_init(), mysql_reak_connect(), ... in VC++ Editor. It shows Errors ;
Compiling... MYSQL.C c:\mysql\include\mysql_com.h(116) : error C2061: syntax error : identifier 'SOCKET' c:\mysql\include\mysql_com.h(135) : error C2059: syntax error : '}' c:\mysql\include\mysql_com.h(167) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql_com.h(167) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql_com.h(167) : error C2371: 'Vio' : redefinition; different basic types c:\mysql\include\mysql_com.h(108) : see declaration of 'Vio' c:\mysql\include\mysql_com.h(167) : error C2143: syntax error : missing ';' before '*' c:\mysql\include\mysql_com.h(167) : error C2059: syntax error : ')' c:\mysql\include\mysql_com.h(168) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql_com.h(168) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql_com.h(168) : error C2059: syntax error : ')' c:\mysql\include\mysql_com.h(169) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql_com.h(169) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql_com.h(169) : error C2059: syntax error : ')' c:\mysql\include\mysql_com.h(170) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql_com.h(170) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql_com.h(170) : error C2059: syntax error : ')' c:\mysql\include\mysql_com.h(171) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql_com.h(171) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql_com.h(171) : error C2059: syntax error : ')' c:\mysql\include\mysql_com.h(172) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql_com.h(172) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql_com.h(172) : error C2059: syntax error : 'type' c:\mysql\include\mysql_com.h(172) : error C2059: syntax error : ')' c:\mysql\include\mysql_com.h(173) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql_com.h(173) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql_com.h(173) : error C2059: syntax error : 'type' c:\mysql\include\mysql_com.h(174) : error C2059: syntax error : ')' c:\mysql\include\mysql_com.h(175) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql_com.h(175) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql_com.h(175) : error C2059: syntax error : 'type' c:\mysql\include\mysql_com.h(175) : error C2059: syntax error : ')' c:\mysql\include\mysql_com.h(176) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql_com.h(176) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql_com.h(176) : error C2059: syntax error : ')' c:\mysql\include\mysql_com.h(180) : error C2146: syntax error : missing ')' before identifier 's' c:\mysql\include\mysql_com.h(180) : error C2061: syntax error : identifier 's' c:\mysql\include\mysql_com.h(180) : error C2059: syntax error : ';' c:\mysql\include\mysql_com.h(180) : error C2059: syntax error : ',' c:\mysql\include\mysql_com.h(181) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(165) : error C2061: syntax error : identifier 'NET' c:\mysql\include\mysql.h(202) : error C2059: syntax error : '}' c:\mysql\include\mysql.h(211) : error C2061: syntax error : identifier 'MYSQL' c:\mysql\include\mysql.h(217) : error C2059: syntax error : '}' c:\mysql\include\mysql.h(232) : error C2061: syntax error : identifier 'NET' c:\mysql\include\mysql.h(238) : warning C4142: benign redefinition of type c:\mysql\include\mysql.h(241) : error C2369: 'last_error' : redefinition; different subscripts c:\mysql\include\mysql_com.h(121) : see declaration of 'last_error' c:\mysql\include\mysql.h(242) : error C2059: syntax error : '}' c:\mysql\include\mysql.h(266) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(266) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(266) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(267) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(267) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(267) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(268) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(268) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(268) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(269) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(269) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(270) : error C2059: syntax error : 'type' c:\mysql\include\mysql.h(270) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(271) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(271) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(271) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(272) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(272) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(272) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(273) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(273) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(273) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(275) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(275) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(275) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(276) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(276) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(276) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(277) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(277) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(277) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(278) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(278) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(278) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(279) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(279) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(279) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(280) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(280) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(280) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(281) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(281) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(281) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(282) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(282) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(282) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(284) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(284) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(284) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(284) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(285) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(285) : error C2143: syntax error : missing '{' before '*' c:\mysql\include\mysql.h(285) : error C2059: syntax error : 'type' c:\mysql\include\mysql.h(287) : error C2059: syntax error : ')' c:\mysql\include\mysql.h(288) : error C2143: syntax error : missing ')' before '*' c:\mysql\include\mysql.h(288) : fatal error C1003: error count exceeds 100; stopping compilation Error executing cl.exe. MYSQL.OBJ - 102 error(s), 1 warning(s) I have corrected this errors by including "winsock.h" header file into my program. After including winsock.h my program work fine and produce my expected results. Herewith I have included the Sample C Program too for your reference... Incase it is a bug you please produce the correct version of mysql.h header file to me. Thanks. regards, Arun. --- Patrick Sherrill <[EMAIL PROTECTED]> wrote: > Statically linking using C API only you will need > mysqlclient.lib > > For odbc interface you'll need to make odbc calls in > your code and use > myodbc.dll (Install myodbc on the client). > > You can mix calls, but why would you. I have found > the C API to be the best > solution for us. We statically link for dll > avoidance. You can get the > source or pre-built client libraries from the MySQL > web site. > > I hope this helps. > > Pat... > > [EMAIL PROTECTED] > CocoNet Corporation > SW Florida's First ISP > 825 SE 47th Terrace > Cape Coral, FL 33904 > > > > > > ----- Original Message ----- > From: "P Arunachalam" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, December 11, 2003 4:31 AM > Subject: reg C API from MySQL > > ________________________________________________________________________ Yahoo! India Mobile: Download the latest polyphonic ringtones. Go to http://in.mobile.yahoo.com
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]