How to add library from submodule to project in Eclipse - c

I use Eclipse with egit
I have a git repo (let's say xxx) with one xxx.h file and one xxx.c file, and wanna use this repo as a submodule inside my project
So I added this submodule in Git Repositories window. Now I have folder xxx in my local repository, near the project folder
I added path to this folder in paths in my projects properties, so now I can compile project with #include "xxx.h" in main.h
But I:
can't see folder xxx in Project Explorer
can't jump to function body, when press F3 on function name (like Eclipse know nothing about xxx.c)
How can I resolve this?

Have you tried refresh on projects?

Try to right click on project name Indexer->Rebuild or Freshen new files

Related

How to push entire React folder to github?

I am working on a project that uses both React and Springboot apps, so I have individual folders for each of those and am trying to get them both into my github repo. I was easily able to drag and drop the springboot folder, but my react one does not upload at all when I drag it into the upload box. Is there an easy terminal command in vs code (the editor I'm using) to add the entire folder?
Since you want to add your 2 different projects in 1 repository, you can firstly put both of your project folder inside 1 main folder, example:
MyFolder:
- MyReactProject
- MySpringbootProject
here MyFolder is your main folder, which has both of your projects, react and springboot.
then finally make a file inside MyFolder with name .gitignore, and put this line inside that file:
**/node_modules
what this file will do, is when you will push your code to github, it will ignore all the files and folders which are listed inside .gitignore file.
You Don't Need node_modules folder
when uploading your code somewhere online, you don't need to upload the node_modules folder, because this folder contains all the dependencies your project need, but when uploading your code online people can download those dependencies by calling the command npm install which will read all the modules needed from your package.json file, and download it on your machine.
To upload your code online you first have to authorize yourself on your local git program, to authorize yourself for github you can read this Article.
After authorizing yourself, firstly make a new empty github repository, by going to github or just by clicking this Link, after making a github repository open Terminal/Command Prompt in your Folder where both of your projects were, in this context my both projects were in MyFolder.
After opening Terminal/Command Prompt enter this commands:
git init
git branch -M main
git add .
git commit "Added all the files"
After running these commands, finally run these 2 final commands:
git remote add origin https://github.com/username/repository-name.git
here, replace username with your github username, and replace repository-name with the name of your repository you specified while make a new repository.
and finally run this command
git push -u origin main
and your code should be pushed on github.
If you don't want to use git commands you can also use, Github Desktop, but it is recommended you first learn basics of git and then use github desktop

The directory react-app contains files that could conflict: package.json

I entered this command to the terminal:
create-react-app react-app
And I get this error:
The directory react-app contains files that could conflict: package.json
Either try using a new directory name, or remove the files listed above
Please help!
If you're on Windows, just go to the Users folder and you'll see that a folder of your project would have been created. Just delete the project folder you want to recreate. And it's done.
Temporarily move the files VScode complaints about to another folder (in your case package.json)
Then create-react-app react-app
Bring back the files
I had the same issue but with a .json file pre-built with new folder I make with VSCODE...deleting the file fixes this issue. Hope this helps someone.
P.S.
React package includes a .JSON file and VS code for some reason has a default .JSON file on new folders(yet to figure that out). Good luck!
In Visual Studio 2022, this happens if you put the project and the solution in the same folder when creating a new project.
SOLUTION
Uncheck the box
Uncheck the box in visual studio for standalone react app
Just delete the README.md
It's working for me.

Eclipse: C project folder structure

I have an existing C project with the following folder structure:
bin
proj
src
inc
doc
conf
When i launch Eclipse and create a new project the root project folder is polluted with:
.cproject
.project
Also the parent folder with:
.metadata
RemoteSystemsTempFiles/
A want to continue use Eclipse as an C IDE with a my custom makefile (or not) but I want all Eclipse related files and folders to be put inside the proj directory. I need Eclipse to debug ARM targets.
Is it possible? If not what is the next best thing?
I made a promise to myself to start a smooth transition from IDEs to vim with a custom makefile. I still need Eclipse to help me for debugging.
One step at a time...
The files .project and .cproject (and the .settings folder if it exists) contains the Eclipse-specific (general and C/C++) project configuration.
The .metadata folder is a kind of cache/temp folder (to store error/warnings markers, local file history, etc.) and also used to store your workspace preferences (most of Window > Preferences).
Files in a project are tracked and can cause changes in the .metadata folder. If the .metadata folder would be located in a project, this could end in an infinite loop.
You could use the workspace folder of Eclipse (which contains the .metadata folder) as part of your overall project folder and link instead of copy all files and folder that you want to see in Eclipse or that are required by Eclipse into your Eclipse project (you can also mark some files and folders as derived to stop them from being tracked and to make them less visible in Eclipse).
Note, do not share or move the .metadata folder (and derived resources). In contrast, .project, .cproject and .settings are intended to be shared.

Import existing file or directory into intellij idea project

I'm using Intellij Idea 15.0.3. I tried to use it to develop a MEAN stack application.
I first File -> New -> Project -> Empty Project to create an empty project. Then in Intellij Idea's terminal I type npm init -y, a package.json is generated. However, when I tried to edit this generated package.json, a window pops up, saying: These files do not belong to the project, and asks me if I want to edit it anyway.
Also, after I edited the package.json, I run npm install in the terminal, a new directory node_modules is generated, but it's not shown in the Intellij Idea.
How can I add package.json and node_modules into project? Do I have to manually created file or folder through Intellij Idea project UI and give up using its terminal?
You need to create a new project from existing source so..
File->New Project - Select HTML5/Javascript application then select one of the options at the bottom with "Existing Sources" at the end of it, you then just specify the folder that it's already and in and you should be good to go.

proper way to handle common header files with C and Git

So i have folders like this
c:\projects\generic\
c:\projects\project1\
c:\projects\project2\
Each folder under projects are their own separate local git repository. A project may use one or more header files from the generic folder. If a project uses a header file, it needs to be right in the project folder, not a subfolder under the project folder. Also, I probably wouldn't want the latest and greatest, I'd want to pull it by tag so I could be sure I have a specific version of the file in use for that project.
How would I do that? Is this something that could be done with submodules? Is there a better way to organize the folders in this situation?
I'd want [...] a specific version of the file in use for that project.
Yup: submodules are for exactly that. A submodule is a nested repository, the using projects' commits record (only) exactly which (other) commit SHA they need checked out at the submodule's path, git submodule just does the chores of getting the right submodule commits checked out when you want.
If a project uses a header file [from another repository], it needs to be right in the project folder, not a subfolder under the project folder [... I'm on windows].
It's lucky these are headers, otherwise there'd be a problem with that combination. As it is, the compiler can chase the relative pathnames with a #include "relative/path/to/submodule/header.h":
repo
|--generic.h: "#include generic1/generic.h"
|--generic1
|--generic.h: the real thing

Resources