In Netbeans when I create a new C++ project from existing sources only the Makefile appears to be under Git version control. The other files (.h, .cpp) all appear to be ignored (grayed out) when viewing from the Projects or Files windows in Netbeans.
How do I make these files tracked?
I have already tried the right-click unignore option.
I do not have a .gitignore file at this point.
You can ignore files in git in other ways than using the .gitignore.
In project folder check the file .git/info/exclude - you can exclude files which yu don't want to keep in .gitignore (which is usually shared with other coders)
You can also ignore files on a global level. Check the settings of Netbeans - it might have a global ignore list used by git.
Related
I cloned a github C++ repository. The repository is not a VS project. So I manually created a VS C++ blank project and added the files from the repo to the project. The files are not copied. This is not the problem.
The repo directory looks like this:
include\NTL\*.h
src\*.cpp
*.h means a bunch of header files and *.cpp means a bunch of .cpp source files.
The problem is that the .cpp files have #include <NTL/*.h> and when I build, VS fails to locate the header files (No such file or directory). Adding the path to the include to the Include Directories in project properties didn't help.
EDIT: After some experimenting, I've found that the error has nothing to do with the prefix NTL in #include <NTL/*.h> but with whether the files are copied into project directory. Even though the files appear in VS project view, they must be copied into the project directory.
EDIT: The only way I've managed to get the project to compile is to put the whole NTL directory containing header files in project directory. Include Directories and Additional Include Directories in project properties don't seem to have any effect.
All previous No such file or directory errors were the result of some combination of:
Mismatching project properties Configuration and Platform
Some .h files were actually missing from NTL github repo, e.g. mach_desc.h.
The solution to the problem consists of the following:
Under project Properties > C/C++, add the path to the include to Additional Include Directories.
VS project has a separate set of properties for each combination of Configuration and Platform. Make sure that step 1 applies to the active Configuration and Platform. E.g. If the project's currently configured to build for Debug x64 (active Configuration:Debug and Platform:x64), make sure that step 1 applies to Debug x64, and not something like Release Win32 or Release x64, etc.
Use the Windows/Linux-specific zip package from the Downloads page of the official website https://libntl.org/download.html
When I created a C++ console project in Visual Studio, I found that besides .cpp files, I had other files like .sln, .vcxproj, .filters, .user.
Should I add them to Git repo?
You can download a .gitignore for Visual Studio. It will make sure only what's necessary to open and work on the project would be tracked, the rest would be ignored.
You can download one from here:
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
I'm working on a solution (C#) with 3 projects in it (one library and two applications) and I wonder what is the bare minimum of files you need to commit to be able to pull off a fresh solution and get it to work right away?
Obviously all source files, *.sln, *.csproj are needed and not the obj folder or bin folder (unless I want to keep a working copy of the compiled files).
But do I need to commit the:
Properties folder
.vs folder
*.resx
*.config
I have Googled it but all I found was a list of the file types, but no explanation of what files where critical to make the solution/project load and compile.
[EDIT]
It has been suggested that this is the same question as: Should I add the Visual Studio 2015 .vs folder to source control?
The question is not related to only the .vs folder, but to all project/solution files.
Though SVN and Git are different Version Control System, I think the files that should be excluded in the Version Control System should be similar. This file is a ignore file for Git (an .gitignore), but should be work as it should in SVN Version Control Systems.
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
This file is often used in various places like Github Destktop, or the Github Site itself.
I use XCode 5.1 for C++ development. I have existing code which I add to the project by dragging files from Finder. The project shows all necessary .h and .cpp files. But when I click Build Phases->Compile Sources, I only see sources that from the root directory in my source structure. None of the source files from subdirectories appear in the Compile Sources. Why? And how to fix this?
Also, when I try to add the missing .cpp file from Build Phases->Compile Sources by pressing +, XCode does not expand the subdirectories, so I cannot select the missing .cpp files.
This is unbelievable. The only problem was that I was adding folder structure with Create folder references for any added folders option instead of Create groups for any added folders.
But still don't understand what is the difference in terms of recognition of source files.
Other peculiarity is that you should add resource files in opposite way (Create folder references for any added folders). Otherwise the iOS application does not find the files and does not compile.
I want to commit my CDT project to SVN. I am a newbie regarding CDT, and I'd like to know the files describing the project.
The concerned files seem to be :
.project
.settings (directory)
.cproject
.csettings (directory)
What are the purposes of .project and .settings ?
.project just include references to XML files stored in the .csettings directory. Some of my co-workers on other projects don't have this .csettings directory : everything is in the .cproject file. Are there some project properties which could make Eclipse delegates all the CDT settings in XLM files in the .csettings directory ?
And what about .csettings ?
Extra question : what is the .directory ?
.project is where Eclipse starts whenever it opens up the project: it tells the workbench what plugins are needed.
.cproject contains the settings specific to the CDT: your project's choice of build configurations, toolchains, individual tools and so on.
.settings can be used by individual plug-ins to store their own project-level preferences.
I've never come across .csettings...
.CPROJECT: This will contain all the settings provided for the particular selected Toolchain. For example, if the project needs to be created with gcc, then this .cproject file will contain all the compiler, linker options used by gcc.
Also if any boot-able files located within the project needs to be excluded that too will be specified here. In general it acts as a make to your project.
.PROJECT: Eclipse uses inbuild make file for linking the object files. This .project file will contain all the builder information (managebuilder).
.SETTINGS: This will contain the debugging information's for the selected toolchain. Like how the "COMPILER\ASSEMBLER\LINKER" includes are separated, eg., by means of ";" like that.
Every eclipse project has a .project file, general project settings (like the name of the project) go here
The .cproject file is where the CDT project specific settings go.
I'm not sure what the .settings and .csettings directories are for. Probably for project specific settings that can't be added to the .project and .cproject files.
On unix files (and directories are just a special type of file in unix) that begin with a . are hidden files.