Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot open include file 1

Status
Not open for further replies.

BlackDice

Programmer
Mar 1, 2004
257
US
have a file that is trying to include the header file for MySQL. I have the file in the project folder and have added it to the project and I keep getting this error:

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

Can anyone help?

bdiamond
 
> I have the file in the project folder
Probably not a good idea to go copying parts of the package like that.

You should have two directories along the lines of
/path/mysql/include
/path/mysql/lib

In the project settings, do the following
For the compiler, locate the entry for "additional include paths". Add /path/mysql/include
For the linker, locate the entry for "additional library paths". Add /path/mysql/lib.
Also locate the entry which lists the names of libraries to look for, and add libmysql.a (or whatever its called) to the list of libraries already searched.

--
 
AArgh!!! I thought I had it, but I guess not. I think I'm putting these additional libraries in wrong or something. this is what I have:

On the Link tab: (with input selected)
Under Object/library modules:
libmysql.lib mysqlclient.lib zlib.lib alxBASEd.lib
under additional library paths:
G:\mysql\lib,G:\downloads\dbase classes\alxBASE\Lib

On C++ tab(with preprocessor selected)
under additional include directories:
G:\mysql\include,G:\downloads\MySql classes,G:\downloads\dbase classes\alxBASE\SRC

All the header files and libraries I need are in those paths. do I need to put quotes around the paths or separate them differently? thanks for any help




bdiamond
 
You almost certainly need quotes around paths which contain spaces.

As for what separator to use - I can't remember off hand, I'm not near VC at the moment.
In order, if I were guessing, spaces, commas, semicolons

--
 
Just looked at my project settings and i have spaces without quotes. I dont think that is the issue. Just as a TEMPORARY test, see if you can use the absolute path for the include to see if the problem is fixed

#include "G:\downloads\dbase classes\alxBase\SRC\<headerfile>"

Do this in all places. If that works, I am at a loss as this should work. The other thing to check is if the include file is spelled correctly.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top