Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Newbie Help to setup C code project and allow advabced search(How to setup C project to allow use of Explore MACRO expansion and other advance search features)
Newbie Help to setup C code project and allow advabced search [message #1542279] Fri, 02 January 2015 14:51 Go to next message
Dan Catchpole is currently offline Dan CatchpoleFriend
Messages: 3
Registered: June 2014
Junior Member
Hi,
apologies for the dumbness of my question.
I want to set up an Eclipe project so that I can browse existing .c .h files of a C language project. I have all .c in one folder and all .h in another folder.

I do not wish to use Eclipse to run the build at this time and I do not wish to set up any compiler settings or build settings in Eclipse.

I just want to be able to search and navigate the C code using Eclipse. I want to be able to use features like Explore Macro Expansion Ctrl+=, Open Declaration (F3) , Open Call Hierachy etc.

So far I can not find how to setup a new project in a way that will allow me to use these features.

If someone can guide me to the right part of the documentation I would be very grateful.
Re: Newbie Help to setup C code project and allow advabced search [message #1542310 is a reply to message #1542279] Fri, 02 January 2015 15:20 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
Moving this to the CDT forum group.
Please note the Announcement message at the top of the Newcomers forum, titled "Announcement: C/C++ Eclipse User Info"

[Updated on: Fri, 02 January 2015 15:21]

Report message to a moderator

Re: Newbie Help to setup C code project and allow advabced search [message #1542445 is a reply to message #1542279] Fri, 02 January 2015 17:06 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Dan Catchpole wrote on Fri, 02 January 2015 16:51
Hi,
apologies for the dumbness of my question.
I want to set up an Eclipse project so that I can browse existing .c .h files of a C language project. I have all .c in one folder and all .h in another folder.

I do not wish to use Eclipse to run the build at this time and I do not wish to set up any compiler settings or build settings in Eclipse.

I just want to be able to search and navigate the C code using Eclipse. I want to be able to use features like Explore Macro Expansion Ctrl+=, Open Declaration (F3) , Open Call Hierachy etc.

So far I can not find how to setup a new project in a way that will allow me to use these features.

If someone can guide me to the right part of the documentation I would be very grateful.


Import the project into Eclipse as a CDT Makefile project. You do not need to use the build command in the project. To see the headers, add them into the directory list in the project properties.

The ways of accessing the browsing features are not exactly the same as in the other IDE you are referring to, but they exist.

The documentation is in the Eclipse C/C++ development toolkit (CDT) documents.


--

Tauno Voipio
Re: Newbie Help to setup C code project and allow advabced search [message #1548951 is a reply to message #1542445] Tue, 06 January 2015 08:27 Go to previous messageGo to next message
Dan Catchpole is currently offline Dan CatchpoleFriend
Messages: 3
Registered: June 2014
Junior Member
Hi Eric,

thank you for relocating this to the more appropriate CDT area Smile
I was not sure if this request was specific to CDT or a general Eclipse feature. Thanks for putting me on the right track.

Hi Tauno,

Thank you for your response and help Smile
I was not referring to any other IDE, the Ctrl+= short cut and the others I mentioned are in Eclipse.
I tried using the New->Project->Makefile Project With Existing Code option. But when I finished there was no new project available in my project explorer area.

I then tried again as a new C/C++ project. I created the project and it appeared in my project explorer (with no subfolders or files present).
Then I used New->Folder to add my 2 folders. I used the advanced options to add as a linked folder resource, although they are both located within the workspace folder, but I am not sure of any other way to add an existing folder to the project yet.

The options such as Ctrl+= to expand macros etc are now working for some #define MACROs but not others. I have confirmed that the definition for the non working MACRO is within the project files. If I do a seach in files or in project the text string is found. However if I search in workspace it is not found.

As all my c files are in one folder, and all my h files are in another folder, both are linked to the project and both are physically within the worksapce folder it is a bit confusing why some MACROs can be found and some can not.

If my explanation of what I did is not clear and someone wants to understand my problem more please let me know.

Thanks again to all for your help and support
I will work my way through the CDT documentation.
I guess Eclipse is such a vast piece of software that it can be a bit daunting and confusing to a new user.
Re: Newbie Help to setup C code project and allow advabced search [message #1549108 is a reply to message #1548951] Tue, 06 January 2015 10:27 Go to previous message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Dan Catchpole wrote on Tue, 06 January 2015 10:27
Hi Eric,

Then I used New->Folder to add my 2 folders. I used the advanced options to add as a linked folder resource, although they are both located within the workspace folder, but I am not sure of any other way to add an existing folder to the project yet.

As all my c files are in one folder, and all my h files are in another folder, both are linked to the project and both are physically within the worksapce folder it is a bit confusing why some MACROs can be found and some can not.

will work my way through the CDT documentation.
I guess Eclipse is such a vast piece of software that it can be a bit daunting and confusing to a new user.


Please check if the h directory is in the list of includes shown in Project Explorer (at left edge of standard CDT perspective layout). Open the list by clicking the triangle at left of the Includes header.

If the directory is not there, open the properties page of your project, either right click the project base icon in the explorer or click the project base and use the Project menu. Open the C/C++ General -> Paths and Symbols dialog, click the Includes tab and use the Add button and its dialogs.

---

I just wonder why the Makefile project setup did not succeed.
- Does the existing project have a make file?
- What steps did you do to set up the project?
- Which C compiler do you use with Eclipse?
- Which operating system?



--

Tauno Voipio
Previous Topic:Beta testers needed for a commercial Visual Studio C/C++ toolchains plugin
Next Topic:greenhills ide
Goto Forum:
  


Current Time: Thu Apr 25 23:20:50 GMT 2024

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

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

Back to the top