Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Include header files
Include header files [message #676095] Thu, 02 June 2011 20:01 Go to next message
No real name is currently offline No real nameFriend
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 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
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
Previous Topic:Compiling imported project
Next Topic:PHP file is not running in Eclipse IDE
Goto Forum:
  


Current Time: Fri Apr 26 06:08:07 GMT 2024

Powered by FUDForum. Page generated in 0.08261 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top