Having trouble with MySQL compilation in Visual C++
I’m working on a database application using Visual C++ and MySQL connector. I’ve set up the project with the necessary library files and include directories, but I keep running into compilation errors.
Here’s my basic test code:
#include <windows.h>
#include <mysql.h>
int main()
{
MYSQL connection;
return 0;
}
The compiler throws these errors:
error C2065: 'MYSQL' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'connection'
error C2065: 'connection' : undeclared identifier
I’ve already added mysql.lib to the linker dependencies and configured the include paths in project properties. What am I missing in my setup? Any help would be appreciated.