This is not a bug, you need to set your project/programming environment in
VC++ to include support for sockets.  I haven't written any non socket
programs in several years, so it's part of my standard set-up.

MySQL is client/server and uses sockets. You do need to link with a socket
library. In the case of VC++ this is Winsock (wsock32.lib).  I normally
include support for sockets in my stdfx.h (#include <afxsock.h>  // MFC
socket extensions). This is included with your VC++ installation and not
part of mysql source.  Then, add wsock32.lib, mysqlclient.lib and any other
external library you need to link with in your 'Project Settings'(Alt-F7').
These are added  under the 'Link' tab in the 'Input' category. Libraries are
added in the 'Object/library module' field separated by spaces (e.g.
'wsock32.lib mysqlclient.lib'). Don't forget to add the path to the
mysqlclient library in the 'Additional library path:' field.

Pat...


----- Original Message ----- 
From: "P Arunachalam" <[EMAIL PROTECTED]>
To: "Patrick Sherrill" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, December 16, 2003 6:36 AM
Subject: Bug in mysql.h header file


> 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'
> 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]


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

Reply via email to