Include header files [message #676095] |
Thu, 02 June 2011 20:01 |
No real name Messages: 1 Registered: June 2011 |
Junior Member |
|
|
Hi everyone,
I have a question for including header files from other folders.
My system background is like as follows.
windows 7 / eclipse CDT / C++ programming
I tried to specify those information under 'project -> properties -> C/C++ General -> Paths and Symbols -> Includes -> language: GNU C++', and I added some header files there. For example, I added path like "C:/Users/steveoh/c/workspace/usr/include/glib-2.0".
In order to use those header files,
I programmed like as follows on the c file.
#include "glib.h"
But, it still generate compile error message like this.
fatal error: glib.h: No such file or directory
Could you explain how I can fix this problem ?
It seems fine to work if I directly copy and paste those header files under root directory. However, it is painful and hard to manage libraries.
If I want to specify library path manually, which one is correct ?
For example,
1.
#include "/users/steveoh/c/workspace/usr/include/glib2.0/glib.h"
or
2.
#include "C:/Users/steveoh/c/workspace/usr/include/glib-2.0/glib.h"
or
3.
#include "glib.h"
or
4.
#include <glib.h>
I though that #3 should be fine if I specify library link.
But, for some reason, it generated error message.
Can anybody help me out to include header files correctly ?
Thanks in advance,
Steve Oh
|
|
|
Re: Include header files [message #677449 is a reply to message #676095] |
Wed, 08 June 2011 14:53 |
Eric Rizzo Messages: 3070 Registered: July 2009 |
Senior Member |
|
|
As mentioned in the sticky topic at the top of this forum, C/C++
questions are best placed in the CDT forum group.
Eric
On 6/2/11 4:01 PM, forums-noreply@eclipse.org wrote:
> Hi everyone,
> I have a question for including header files from other folders.
> My system background is like as follows.
> windows 7 / eclipse CDT / C++ programming
> I tried to specify those information under 'project -> properties ->
> C/C++ General -> Paths and Symbols -> Includes -> language: GNU C++',
> and I added some header files there. For example, I added path like
> "C:/Users/steveoh/c/workspace/usr/include/glib-2.0".
> In order to use those header files, I programmed like as follows on the
> c file.
> #include "glib.h"
>
> But, it still generate compile error message like this. fatal error:
> glib.h: No such file or directory
>
> Could you explain how I can fix this problem ? It seems fine to work if
> I directly copy and paste those header files under root directory.
> However, it is painful and hard to manage libraries.
> If I want to specify library path manually, which one is correct ?
>
> For example, 1. #include
> "/users/steveoh/c/workspace/usr/include/glib2.0/glib.h"
>
> or
> 2.
> #include "C:/Users/steveoh/c/workspace/usr/include/glib-2.0/glib.h"
>
> or 3. #include "glib.h"
>
> or
> 4. #include <glib.h>
>
> I though that #3 should be fine if I specify library link. But, for some
> reason, it generated error message.
> Can anybody help me out to include header files correctly ?
> Thanks in advance, Steve Oh
|
|
|
Powered by
FUDForum. Page generated in 0.08261 seconds