How do I get Eclipse CDT to ignore files - c++

I have a C++ project in Eclipse. The project uses Perforce and Eclipse has the Perforce plugin installed. Everything was fine, until I decided to create a git repo in my project. I created the git repo to snapshot some changes which I wasn't ready to commit. Everything was fine until I refreshed my files in Eclipse. Two problems have occurred:
Eclipse found my .git folder, and indexed all of the files inside of it.
Eclipse also decided to add all the git file to my pending change list.
If I create a new file within Eclipse, I'd like it to add it to Perforce, but if it happens to find a file, I don't want it to do anything with it. I'd also like to give Eclipse a list of file types to always ignore, just like I do with my .gitignore file.
I'm using the P4WSAD plugin, but I'm pretty sure the problem can occur anytime you have files you want Eclipse to not see.

Just add a file .p4ignore in your project root and add everything you want P4WSAD to ignore, such as
.git
See the docu on P4WSAD for more info.
That should take care of the Perforce part of your question. For the Eclipse part, please see this SO question.

Related

Which files to remove from VCS in C++ project in Clion?

I am new to C++, and am running CLion with github.
I have the basic hello world project set up, and there are several .xml files in a /.idea folder that I am not sure I should be including. Right now, I am including everything. My question is: what can I leave out of vcs?
Here is a snapshot of what I have (the .xmls are at the bottom; right now everything has been added to VCS, so they are all green):
The specific question is:
If I do not add the .xml files to version control, and I checkout the code from some other computer, will I be able to run the code? Or are some of the .xml files needed?
(didn't realize this was too broad. will delete if it is still too broad).
you can omit the entire .idea folder by creating a .gitignore file in the root directory and adding a line for
.idea
then you can select the .idea folder and under 'vcs' or 'git' choose 'revert' to remove them from staging if you have not committed them or to undo the commits that added them to the repo
good luck!

Visual Studio Folders with Github

I have installed github a few days ago and just getting the hang of things, managed to figure out how to put my VSO source file into github repositories but since VSO makes an entire directory for each program full of other files along with the source file which go into the rep aswell. I'm not really sure if that's how it should be or not, But I would like for just the Source file to be sent into the repository.
Till now I've been adding with
git add .
I have tried the
git add <filename.cpp>
or
git add <filename>
but it didn't recognize it I think cuz the source file is within the directory that VSO made for it which is within my rep
Alright I think i figured it out for now,I went one directory deeper and tried the git add <filename> again and it no longer shows the other uneccesary VSO files on my rep.ty

Eclipse CDT build always rebuild all files

I am working with Eclipse Luna with CDT plug-in.
Whenever I build the project it keeps rebuilding all files, even if I just modify specific .cpp file.
I use project -> build project for the build.
I also removed build automatically option (and re-opened eclipse), but it did not solve the problem.
I've searched a lot for similar questions, but found none.
Are you using a manually-managed Makefile project, i.e. one that is not automatically-managed by the CDT plugin? If so, perhaps you could post your Makefile contents here, because there may be issues with the target dependencies in it.
The File | New | C++ Project | Executable option creates a project in which CDT automatically creates and updates the Makefiles itself - in this setup, the dependencies (while not perfect, because there are a few bugs in CDT in this respect) should be managed well enough so that it won't rebuild the entire project just because one file changed.
On the other hand, if you imported an existing project via the menu File | New | Makefile Project with Existing Code (which I didn't previously mention), then you would have had to copy the Makefile from the existing project manually, as CDT doesn't copy it for you, or you would have had to manually create a Makefile.
As I mentioned previously, if you posted your Makefile (feel free to 'sanitise' it by removing any personal information), we might be able to determine why it's rebuilding all files when you've only updated one of them.
I would have posted this as a comment reply to your last comment, #davidgrandson, but apparently there's a fairly short limit on the length of these.

C++ Adding libcurl (using Curl)? - My attempts explained

Okay, so I know this sounds like a very nooby question but I did my best so please hear me out before adding negative comments/downvoting.
Okay, so from what my research says, using "cURL" for my C++ program when involving anything web-related is the best way to go. Now, me being new to C++, I didnt want to ask questions for every step and try doing it myself, apparently, this was not the case.
Problem: CodeBlocks is not recognizing the curl plugin (saying it does not exist)
Goal:
Attempt to make the example source located here (from the official cURL website) work.
Attempt 1:
So, I downloaded the plugin using the "help manager" where it shows which is the best thing to download. I got the .zip file "curl-7.24.0-devel-mingw32" back. I decided to copy the contents of the "bin" folder to my projects bin and copy the "include" folder to my project. It kept saying it did not recognize "/curl/curl.h" or saying it did not exist.
Attempt 2:
Without deleting the "bin" and "include" folder, i decided to move the "curl.h" folder into my project itself (via CodeBlocks) by creating a folder called "curl" and then putting the "curl.h" inside the folder (The folder "curl" was in the "Headers" folder created by the program) and attempt to run it again seeing that it existed. Same Error
Attempt 3:
After countless searches, I come across that I should put my curl files and all the files inside the "bin" folder into C:\Windows\ folder. So I copied everything in the "includes" folder and the contents of the bin folder (including the "curl" folder in it) to the WINDOWS folder. Same error.
Attempt 4: - Sort of...
Now, there was something about going to my project options and selecting certain files to import and that stuff but it was way more confusing because each site had different options so im unable to do recall the steps.
Im now relying on the StackOverFlow community to give me a hand. I tried explaining my problem in the most detailed way but if you have any questions or need more information, dont hesitate to ask. Also, here is the errors im getting:
http://pastebin.com/raw.php?i=B1wsqvmA
Here is my source:
http://pastebin.com/raw.php?i=YShFZf8G
Can someone please guide me through this mess? Thank you so much!
the problem is that you're not telling codeblocks where to search for the include files, you shouldn't be copying the headers to the project's folder.
You can select the include directories this way:
In Project -> Build Options -> Search Directories -> Compiler
There is a button to add include directories, in this case the "include" folder of libcURL, And that error should be gone.
You will have to follow a similar process to add the files for the linker.

Project properties lost on external checkout

Our company might be moving from CVS to Subversion soon. This has brought about an issue for us, which I am trying to solve.
For CVS and Eclipse, we were able to use team project set files to gather various modules and check them out together (http://vpms.de.csc.com/projectset/). This made it very easy to manage projects, since there was no need to remember each module in the project.
However, project sets do not support SVN. I know there is an 'externals' property for SVN that does approximately (or possible exactly) the same thing. I tried this. Now, for the problem:
When I use the externals property and checkout 2 modules in eclipse, their C/C++ project properties are lost, and so I cannot right click on them to say "build project" or "clean project". They appear to Eclipse to be folders with files in them.
Is there something I am missing here?
EDIT
When I check out each module separately, they check out as projects, so they do have the individual .project/.cproject/settings stuff
You forgot to place Eclipse project metadata into your source control system. Make sure all files starting with '.' in project root make it in along with the entire contents of the .settings directory.
Subversion externals simply allows you to take files from one part of the repository and bring them in under a folder in your local checkout. At my last company, we had a java source directory that called "commonSrc" that was an SVN External for another project's main "src" directory, but in the project it was brought into, it simply acted as another folder (as you are experiencing).
I never really liked that method and wouldn't recommend it unless you have only one/two modules.
In order to do what you are trying to do with SVN, you might have to checkout each project separately, and use "Module Dependencies" in the project's properties to create the proper dependencies in Eclipse. You might be able to commit these project files so that the next person doesn't have to re-link them.
In case anyone needs this, here's what I found:
http://vpms.de.csc.com/projectset/
&
http://www.polarion.org/index.php?page=download&project=subversive
OR
http://www.giniality.com/old/update/projectset/
for Subversion + Project Set integration.
There is no need to break your project set. Once you have the integration plugins installed in Eclipse, all you need to do is change the source from the CVS server to SVN.