help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [G++ n00b] Include and lib files


From: Lionel B
Subject: Re: [G++ n00b] Include and lib files
Date: Fri, 16 Nov 2007 17:30:43 +0000 (UTC)
User-agent: Pan/0.132 (Waxed in Black)

On Fri, 16 Nov 2007 17:15:57 +0100, Stefan Kristensen wrote:

> Hello my experienced friends.
> 
> As previously stated, I'm refreshing my C++ on a FreeBSD box and the
> basics are pretty much in place now. So time to move on: Accessing MySQL
> databases from C++.
> As I see it, there is a wrapper class that makes it somewhat easier than
> using the C API. But already at the #include "mysql.h" line, I get an
> error: No such file or directory. I have installed MySQL and MySQL++1
> (MySQL++ reported something as broken) and can see mysql.h in
> /usr/local/include/mysql
> 
> So: How do I tell g++ where to look for include files?

Most likely /usr/local/include will be on the include path for your g++ 
by default, so:

    #include "mysql/mysql.h"

should work.

Otherwise, you can tell g++ to search a directory for included headers 
via the -I flag. See:

http://gcc.gnu.org/onlinedocs/gcc-4.2.2/gcc/Directory-Options.html

for details.

Cheers,

-- 
Lionel B


reply via email to

[Prev in Thread] Current Thread [Next in Thread]