C++ and MySQL

problem with connecting c++ and mysql

Page 1 of 1

2 Replies - 3416 Views - Last Post: 01 June 2010 - 03:49 PM Rate Topic: -----

#1 LordRaydenMK  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 17-May 09

C++ and MySQL

Posted 01 June 2010 - 03:30 PM

I'm trying to connect c++ with MySQL using Visual Studio 9 and MySQL 5.1
Posted Image
the error I get is:
------ Build started: Project: mysql proba2, Configuration: Release Win32 ------
Compiling...
main.cpp
c:\program files\mysql\mysql server 5.1\include\mysql_com.h(243) : error C2146: syntax error : missing ';' before identifier 'fd'
c:\program files\mysql\mysql server 5.1\include\mysql_com.h(243) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\mysql\mysql server 5.1\include\mysql_com.h(243) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\mysql\mysql server 5.1\include\mysql_com.h(417) : error C2065: 'SOCKET' : undeclared identifier
c:\program files\mysql\mysql server 5.1\include\mysql_com.h(417) : error C2146: syntax error : missing ')' before identifier 's'
c:\program files\mysql\mysql server 5.1\include\mysql_com.h(418) : error C2059: syntax error : ')'
Build log was saved at "file://c:\Users\stole\Documents\Visual Studio 2008\Projects\mysql proba2\mysql proba2\Release\BuildLog.htm"
mysql proba2 - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Is This A Good Question/Topic? 0
  • +

Replies To: C++ and MySQL

#2 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: C++ and MySQL

Posted 01 June 2010 - 03:39 PM

Include winsock.h before you include mysql.h
Was This Post Helpful? 2
  • +
  • -

#3 LordRaydenMK  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 17-May 09

Re: C++ and MySQL

Posted 01 June 2010 - 03:49 PM

View PostOler1s, on 01 June 2010 - 02:39 PM, said:

Include winsock.h before you include mysql.h

thanks, it works fine now.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1