MySQL Forums
Forum List  »  Connector/C++

error C2894 compiling C++ connector on Visual Studio 9 2008
Posted by: Paul Aanei
Date: February 12, 2009 05:42PM

I've downloaded the C++ connector and tried to build it on Windows Vista with Visual Studio 2008, but got the compile errors like this one:

2>mysql_connection.cpp
2>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\wspiapi.h(48) : error C2894: templates cannot be declared to have 'C' linkage

wspiapi.h is included conditionally in ws2tcpip.h like this:

#if !defined(_WIN32_WINNT) || (_WIN32_WINNT <= 0x0500)
#include <wspiapi.h>
#endif

Finally _WIN32_WINNT is defined in config-win.h:

#define _WIN32_WINNT 0x0500

So I have changed the line to a greater version 0x0600 and the build was successful.

Can anyone confirm if this is the right thing to do.

Many thanks in advace,
Paul

Options: ReplyQuote


Subject
Views
Written By
Posted
error C2894 compiling C++ connector on Visual Studio 9 2008
7159
February 12, 2009 05:42PM


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.