[Top][All Lists]

[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: Mon, 19 Nov 2007 09:47:32 +0000 (UTC)
User-agent: Pan/0.132 (Waxed in Black)

On Fri, 16 Nov 2007 20:20:01 +0100, Stefan Kristensen wrote:

>>> 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:
> It is.
>>     #include "mysql/mysql.h"
> This gives: test1.cpp:2:47: mysql/mysql.h: No such file or directory If
> I use the -I option, it finds the mysql.h file. What's wrong?

Ah, I think perhaps that should be:

    #include <mysql/mysql.h>

> After compiling with the -I option, I get: undefined reference to
> 'mysql_init'.

You also have to link to the appropriate library(s). Hopefully the docs 
will tell you how to do that.


Lionel B

reply via email to

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