Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Include path to every new project(How to Include path to every new project?)
Include path to every new project [message #1697053] Mon, 01 June 2015 08:58 Go to next message
kobi danone is currently offline kobi danoneFriend
Messages: 14
Registered: November 2014
Junior Member
Hello,

In my projects, I go to Project Properties -> C/C++ General -> Path and Symbols -> Includes -> GNU C and add my own path.
I also go to Project Properties -> C/C++ General -> Preprocessor include path -> providers and select the CDT Cross GCC Built-In compiler settings.

I need to do it automatically for every new project.
How can i do it?
I already created Eclipse Plugin project (.jar) for other settings and files, Can i use it for this goal?

Thank you in advance!

[Updated on: Mon, 01 June 2015 09:09]

Report message to a moderator

Re: Include path to every new project [message #1699403 is a reply to message #1697053] Wed, 24 June 2015 06:17 Go to previous messageGo to next message
kobi danone is currently offline kobi danoneFriend
Messages: 14
Registered: November 2014
Junior Member
Update:
Succeed by changing the tamplate file in the plugin project.

<process type="org.eclipse.cdt.managedbuilder.core.AppendToMBSStringListOptionValues">
<simple name="projectName" value= "$(projectName)"/>
<complex-array name="resourcePaths">
<element>
<simple name="id" value="org.eclipse.cdt.build.core.settings.holder.incpaths" />
<simple-array name="values">
<element value= "${INC}" />
</simple-array>
<simple name="path" value="" />
</element>
</complex-array>
</process>

Thank you.
Re: Include path to every new project [message #1699696 is a reply to message #1699403] Thu, 25 June 2015 22:48 Go to previous messageGo to next message
Wayman Bell is currently offline Wayman BellFriend
Messages: 3
Registered: June 2015
Junior Member
I think my question is similar to yours, but I do not understand at all what your solution was. Sad

tldr: Is there a way to make changes to default C++ project settings so that I don't have to manually add the includes paths for every individual project?

I'm using Ubuntu 15.04 and the new Eclipse Mars for C++. I've got the build-essential tools installed (so, g++, gpp, other stuff...) and am using the official Oracle Java 8. This seems to be the most stable way I have found of getting this to all run. I've literally spent the last three months reinstalling the OS and my desired programs in various ways to arrive at this. I'm pretty much a newb to the OS and Eclipse, both. But I digress.

After struggling with Eclipse not liking "#include <iostream>" or "using namespace std;" for quite some time, I finally figured it out, I think. Eclipse is defaulting to my gcc 4.9 files, but my version of gcc is 4.9.2. I've added the 4.9.2 includes directories in my project settings and this cured everything! I still could not compile with gcc, though. I used g++ to compile and everything worked. So now I've figured out how to compile and run both with Eclipse and g++.

I've used this to successfully mess around a bit as I'm reading through my chosen text. Now I'm ready to start doing the chapter exercises and would like to make a different project for each chapter. If I do, though, I have to go back into Project->Properties->C/C++ General->Paths and Symbols->Includes and add the ~4 paths back in for each project. I would really like to set this to happen automatically. Or could someone explain why the 4.9 paths are failing (they are there, it just doesn't work with them).

Thank you in advance!
Re: Include path to every new project [message #1701350 is a reply to message #1699696] Sun, 12 July 2015 12:17 Go to previous messageGo to next message
Geoff Kaniuk is currently offline Geoff KaniukFriend
Messages: 5
Registered: July 2013
Junior Member
I think this is a good question. The namespace std:: should automatically be setup in your system. The answer I got from the gnu gcc manual was to create a dummy program 'dummy.cpp' with just one directive: using namespace std; then run the command below:
~$ g++ -v dummy.cpp

There is a huge amount of output, but eventually you find a sequence:
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.7
 /usr/include/c++/4.7/i486-linux-gnu
...
End of search list.

This is followed by a number of settings for environment variables which may have a bearing on the problem. I am running eclipse 3.8 on Debian Wheezy, and I have checked that the above list agrees with the installed package for libstdc++-dev . It also agrees with the list displayed in Eclipse Project
>>Properties
  >>C++ General
     >>Preprocessor Include Paths, Macros etc.
        >>GNU C++
            >>CDT GCC Builtin Compiler Settings


I hope this helps a bit, but my question is: How exactly does eclipse 'know' where std is installed?


Geoff
Re: Include path to every new project [message #1701590 is a reply to message #1701350] Tue, 14 July 2015 10:29 Go to previous message
kobi danone is currently offline kobi danoneFriend
Messages: 14
Registered: November 2014
Junior Member
Hi Wayman BellFriend,

You should create plugin project, enter the compiled plugin into eclipse and then check this post again.
I recived the project already ready so i can't help you building that, but i'm sure you find answers on the web.

[Updated on: Tue, 14 July 2015 10:30]

Report message to a moderator

Previous Topic:Symbol 'std' could not be resolved
Next Topic:Setup Project Explorer to show only functions
Goto Forum:
  


Current Time: Thu Apr 25 08:05:46 GMT 2024

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

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

Back to the top