fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory

I'm using Vc++ pro. I have installed MySql and set the include directory

C:\Program Files\MySQL\include\

in my project directory, that include folder does have mysql.h so I can't figure this out, anyone got an idea?

Recommended Answers

All 3 Replies

ave you tried copying the mysql.h file to vc++'s include folder?

Maybe you could add it to your INCLUDE environment variables in Windows
(Note: exact sequence here may be different on WinXP/Vista ... i'm using Win2K)

  • Right-click on My Computer and choose Properties
  • Go to the Advanced tab, and press the button for Environment Variables.
  • Scroll down the list of system variables, and look for the one called INCLUDE

the variable will look something like this...

d:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\include\

add a semicolon to the end, and then add C:\Program Files\MySQL\include\

so it'll look more like..

d:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\include\ [B]; C:\Program Files\MySQL\include\ [/B]

You might need to restart for it to take effect... but after that, try compiling it again :)

Or just put that path into the project settings.
Something like compiler->pre-processor->additional search paths.

Copying the header files to the vc++ standard include directory is a bad idea. If there are any conflicts now (or in the future), you're screwed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.