MySQL Forums
Forum List  »  Connector/C++

Trouble compiling/installing with MSVC9
Posted by: ben summer
Date: October 26, 2009 03:15PM

Hi, For a while, I've been trying to install the C++ connector with MSVC9.

About two days ago, I got IntelliSense to pick up on the connector functions, but for some reason, when I go to compile my program, I get a compile error, even when I don't call the MySQL functions.

Ex:
#include <iostream>
#include <mysql.h>

using namespace std;
int main() {

cout << "Hello MySQL!" << endl;

system("PAUSE");
return 0;
}

Error:
1>------ Build started: Project: MySQL Test, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>c:\program files\mysql\mysql server 5.1\include\mysql_com.h(243) : error C2146: syntax error : missing ';' before identifier 'fd'
1>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
1>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
1>c:\program files\mysql\mysql server 5.1\include\mysql_com.h(417) : error C2065: 'SOCKET' : undeclared identifier
1>c:\program files\mysql\mysql server 5.1\include\mysql_com.h(417) : error C2146: syntax error : missing ')' before identifier 's'
1>c:\program files\mysql\mysql server 5.1\include\mysql_com.h(418) : error C2059: syntax error : ')'
1>Build log was saved at "file://c:\Documents and Settings\Ben\My Documents\Visual Studio 2008\Projects\Learning\MySQL Test\MySQL Test\Debug\BuildLog.htm"
1>MySQL Test - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

It seems that nothing is wrong with my program, just what I am including.

I do have two instances of MySQL installed (one regular, another in WAMP Server).

Any help is really appreciated.

Options: ReplyQuote


Subject
Views
Written By
Posted
Trouble compiling/installing with MSVC9
4873
October 26, 2009 03:15PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.