Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Include Header files in Eclipse(I need a beginner version on how to add header files and )
Include Header files in Eclipse [message #1839122] Mon, 15 March 2021 06:44 Go to next message
Luca Fleischanderl is currently offline Luca FleischanderlFriend
Messages: 2
Registered: March 2021
Junior Member
So first of all, I'm completely new to Eclipse , I have learned C++ for about 5 months now and this is probably some basic stuff for y'all.

I use Eclipse IDE for C/C++ Developers - Version 2020-12 (4.18.0) on a MacBook Pro - macOS Big Sur - Version 11.2.1.

First: For my study I have to include two header files to my eclipse. "CImg.h" and "Drawing.h" and I should link a Drawing.cpp file as well. How do i do this?

Second: I should also add the files "pthread" and "X11".

I have instructions (I put them at the end for you) for Linux but when I follow them step by step it doesn't work on my Mac.

There are loads of errors appearing but in the line of #inlcude "Drawing.h" it says "unresolved inclusion" so where do I have to do something else?

I would really appreciate your help as I need this to get started!


These are the instructions that should work on Linux:

"Project -> Properties -> C/C++ General -> Paths and Symbols -> Includes -> GNU C++ -> Include directories -> Add" choose the installation paths of "CImg.h" and "Drawing.h"

"Project -> Properties -> C/C++ General -> Paths and Symbols -> Libraries -> Add" add the file "pthread" and "X11" (just type the name)
Re: Include Header files in Eclipse [message #1839145 is a reply to message #1839122] Mon, 15 March 2021 18:26 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 684
Registered: August 2014
Senior Member
The files pthread and X11 are Linux-specific. It is fairly possible that you will not be able to use them directly in MacOS, especially on Big Sur which seems to have more than its share of compatibility problems.


--

Tauno Voipio
Re: Include Header files in Eclipse [message #1839153 is a reply to message #1839145] Tue, 16 March 2021 07:05 Go to previous messageGo to next message
Luca Fleischanderl is currently offline Luca FleischanderlFriend
Messages: 2
Registered: March 2021
Junior Member
Oh ok, then I need to talk to my professor if there is any other possibility.

Thanks for your reply!
Re: Include Header files in Eclipse [message #1839278 is a reply to message #1839122] Thu, 18 March 2021 15:09 Go to previous message
madanswer ask is currently offline madanswer askFriend
Messages: 1
Registered: March 2021
Junior Member
you can follow below steps for the same


    Right click on the project and select properties.
    Select C/C++ General -> Path and Symbols.
    Select Includes tab.
    In Languages list, select 'GNU C' or whatever C compiler tool chain you use.
    Press 'Add...' button and add the directory for the include files.
    Close Properties window and rebuild. You should see new path being used as -I in build process.

Previous Topic:Error in opening files of existing code
Next Topic:Makefile build configurations
Goto Forum:
  


Current Time: Tue Nov 30 04:08:42 GMT 2021

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

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

Back to the top