Sign in to follow this  

Got some errors and dont know what to do about it

This topic is 4751 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, This is the problem, I'm making a program with VC++ 2003, which will connect to a remote mysql server using the mysql C api. I think i've included the right directories / libs, but it keeps sending me build errors. At first i thought i should add the winsock2.h and the wsock32.lib, but that will result in 100+ build errors for some reason. The errors i have now, return from mysql_com.h: f:\mysql-4.1.7-win\include\mysql_com.h(304): error C2065: 'SOCKET' : undeclared identifier f:\mysql-4.1.7-win\include\mysql_com.h(154): error C2146: syntax error : missing ';' before identifier 'fd' f:\mysql-4.1.7-win\include\mysql_com.h(154): error C2501: 'st_net::SOCKET' : missing storage-class or type specifiers f:\mysql-4.1.7-win\include\mysql_com.h(154): error C2501: 'st_net::fd' : missing storage-class or type specifiers f:\mysql-4.1.7-win\include\mysql_com.h(304): error C2146: syntax error : missing ')' before identifier 's' f:\mysql-4.1.7-win\include\mysql_com.h(304): error C2059: syntax error : ')' they are about these two lines: my_socket fd; and int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen, unsigned int timeout); I've been trying for days now to get the C api to work, but i havent made a single successful connection with the server yet please help im desperate! Greetz,

Share this post


Link to post
Share on other sites
It seems you need to include some other header before mysql_com.h:
[edit]

#include <windows.h>
#include <Winsock2.h>
#include <mysql.h>
#include <mysql_com.h>


[/edit]
Would the above work?

Share this post


Link to post
Share on other sites

This topic is 4751 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this