Git how to ignore untracked CDT files - c++

I'm working on a C++ project, after imported this project to eclipse, there are 3 new files/folders generated, they are:
.cproject
.project
.settings/
Not every one is using eclipse, so I'm not allowed to push this files to the repository, but I need them in order to work on eclipse, what should I do in such a situation when do the pushing.

You could add rules to the .gitignore file (and push that change by itself) so that they won't appear in git's list of working directory changes when you are ready to stage files for a commit.
Git Ignore Documentation

I installed the EGit plugin for eclipse found here:
http://www.eclipse.org/egit/
In order to manage the hidden files in a C++ project I open the Navigator by selecting menu option:
Window -> Show View -> Navigator.
In the Navigator (on the left hand side) you can see all the files that are hidden from a C++ project (like .cproject).
Select all the files/folders you need to ignore, right-click on the selection and go to popup menu item:
Team -> Ignore.
When you first ignore files in a folder a new file may appear (if its not already there) called .gitignore. You need to decide if the .gitignore file is going to be shared project-wide or not. If it is not currently being tracked and it needs to be you can add it to the index by right-clicking it and selecting Team -> Add to index. If it is not going to be tracked in the repository then you can select that file and ignore it.
Hope that helps.

Related

I Don't Know How To Use/Run These Files That Are In A Github C++ Library I'm Trying To Add To My Project?

https://github.com/gladosconn/ecdsa_cxxI have been trying to get this library into my project (C++ using Visual Studio 2022, in Windows) because I need to use the ecdsa signature algorithm, I have copied all the files in src folder to a folder called "ecdsa" in the src folder inside my project, and I didn't do anything with the test folders (I think that I don't need them since they're just tests), but then there are these files (.ytml) ,(.txt) ,(.py), I have no idea what am I supposed to do with them or where to put them, but I sure I need them because the program isn't working, it's giving me this error Cannot open include file: 'secp256k1.h': No such file or directory Libraries.Also I have done everything in the requirements section, my compiler supports C++11, and I have installed openssl, and I have CMake installed.This is my first time using anything from Github so I'm sure what to do.
In Visual Studio, right-click on your project in the Solution Explorer pane. From the menu that pops up, choose the 'Properties' item. It is usually at the very bottom. A dialog box will appear.
In the left pane of the dialog box, expand the options Configuration Properties > C++ > General. Now, in the right pane of the dialog box, probably at or near the top will be an item labeled 'Additional Include Directories`. Add the full path to the folder where you copied the source files from GitHub.
You may need to explicitly add ALL the files you downloaded from GitHub into your Visual Studio project.
Try compiling again.

How do I rename a Django project in PyCharm?

What do I need to do in order to rename my Django project in PyCharm? I am new to Django and PyCharm and would like to use a different name for my project.
The built-in solution for re-naming Django projects in PyCharm has worked for me in the past on small projects, although I haven't tried it on a large project yet. To use it, select the project folder from the file-tree (by default on the left hand side of the screen), then press shift-F6 to bring up the rename dialogue. You can enter in your new name here and preview the changes, which can help prevent surprises. If you're happy with the preview, click on the "Do Refactor" button at the bottom of the window.
This is also a useful way to rename Django apps.
You can access the same functionality through right-clicking on the folder/item and hovering over the Refactor sub-menu. Or pressing ctrl+shift+a and searching for rename.
I'm using Windows, but it's probably the same for other operating systems.
Close PyCharm, open the directory in Windows Explorer (or your favorite file manager).
Rename the project directory
Rename the subdirectory of the same name that is inside your project directory
Open the .idea directory (in the project folder), rename the .iml file
Also in the .idea directory, open the .name file in a text editor and change the name in there
Open the project in PyCharm again.
In the settings.py file, you'll need to update the path specified in TEMPLATE_DIRS
You may also want to update your Run/Debug configurations (Alt-Shift-F10).
You'll need to replace some other occurrences of your old project name. In PyCharm, Ctrl-Shift-F will allow you to search the contents of all your files to find these occurrences.
Maybe: right-click on root folder in "Project" window, choose Refactoring -> Rename and choose "Rename Project"
svass's answer worked for me, except that I also had to manually change instances of my old project name in files located inside the .idea directory of my project.
If you cd into your project directory and grep for your old project name
grep -rli oldprojectname ./.idea
That returned the following list for me, then I manually modified each file.
./.idea/modules.xml
./.idea/workspace.xml
./.idea/dataSources.xml
./.idea/oldprojectname.iml <-- this will need to be renamed to new project name, and it's contents modified
./.idea/dataSources.ids
./.idea/.name
./.idea/misc.xml

Eclipse CDT add existing source without copying

I have a C++ project proj1 with some source files in, however I would like to also use some of the source files I have in another project proj2. proj1 and proj2 are both subdirs of a directory my_projects. I don't want eclipse to copy the files as I want to ensure I have only one copy to edit. This is like the "add existing item" option of MS Visual Studio.
The end result I'm aiming for is to be able to create makefiles for both proj1 and proj2, zip up the two directories together and send them to coworkers so they can build the two projects themselves using make.
Is this possible in Eclipse? I've searched and haven't found the solution.
Phil
If you have proj2 open in Eclipse right click on the project and choose Import... and then select General > FileSystem and hit next. In the top window choose the directory in proj1 that contains the resources you want to link. After selecting the files you want to link in the top window hit the Advanced button to open up a submenu and select Create Links in Workspace as shown in this screenshot:
This question addresses setting up a Makefile with relative instead of absolute paths: Getting Eclipse CDT to use relative include paths in generated Makefiles
I looked forever for a solution to this, and I finally found it. Right click on the project and select Build Settings. Under the Build header on the left click "Settings". Then under the "Tool Settings" tab click "Directories" under the compiler header. Then click the add button at the top. If the desired files are in another project in the same workspace click the workspace button and then navigate to the exact folder where the files are. Once you have done this voila! you should be able to build the project!

How to get back a file that was excluded from a build configuration in Eclipse CDT?

Using Indigo and a managed build C++ project, I right-clicked on a source file and selected Resource Configurations->Exclude From Build..., and the file promptly disappears. Scrolling down shows it at the bottom of the list of source files with a new dimmed icon. Now how do I get it back? The Reset to Default... option is always dimmed out. Right-clicking on the excluded file still only shows the Exclude From Build... option. Is there an Include in Build option somewhere? I realize I can go to .cproject file and manually edit it back in but I figure there must be a way to do it from the IDE.
Yes this is an old question. But people do go looking for answers years later..
There's an easy way, but it's counter intuitive. Right click the excluded item, select "exclude from build", and on the dialog that appears, uncheck the builds for which you'd like the item back. Note the convenient 'Deselect All' button.
In eclipse there's not a similar way to reinclude resource, like:
Resource Configuration -> Reinclude from build
You need to go in Project Proprerties (Alt+Enter) and go:
C/C++ General -> Paths and Symbols
Select tab
Source Location
and expand your project's folder: here you can select filter that you want to remove and click on "Edit Filter" and then "Remove".
While I still don't know how get back a file that's been excluded. I have discovered that it's much better to just add a new folder, and then mark the folder as excluded. Then files can be excluded by dragging them into this folder and included back by dragging them back to the original folder.

How do you compile Box2D for Code::Blocks/MinGW32 under Windows?

I've found similar questions across the internet, none of which helped me. The Code::Blocks workspace and project files included DO generate .a files, and I've moved them to Codeblocks/MinGW/lib, and I've moved the Box2D folder to Codeblocks/MinGW/include and yet the HelloWorld.cpp example still gives me these errors.
Looks like the project files you used to build the .a were missing some files. The file mentioned in the error message is one that was removed from Box2D after v2.1.2, so I'm guessing you are using 2.1.2 source code (or thereabouts) with project files from some other source?
In any case, setting these up yourself is really simple. In the 'Management' panel, right click the 'Engine' project, select Remove files and click OK to remove everything.
Now do the same and select Add files recursively, choose the folder that contains Box2d.h file:
Click OK a few times, and you're done.
In your case, since you had it building already I would expect this to be ok now but for anyone arriving here wanting to setup a project file from scratch, you'll also need to specify the search path for the Box2D headers.
To do this, in the same right-click menu choose: Properties -> Project settings tab -> Project's build options button -> Search directories tab -> Add button. Now choose the parent folder of the one you just chose above.