0

I am using VSCode 1.78.2 I have a C project, based on a Nordic example. I would like to take a copy of this project and modify it etc. So the question is - how do you copy a project in VSCode, so that any dependencies etc, refer to the new project, and not the original? I looked at this old answer, but my version of VSCode does not seem to offer any Project - Export Template option

I had not worded this issue very well.

Essentially, I had a project (from Nordic Semiconductor nRF examples), and in Windows Explorer, I copied it to another folder, then opened this copied project in VSCode, built, edited etc. - but found that when I edited the main.c in the copied project, it was modifying the main.c in the original project.

I think I have everything working now.

What I did was, after opening the copied project in VSCode, I deleted the build configuration, and defined a new one - rebuilt - and all seems to be ok now.

starball
  • 20,030
  • 7
  • 43
  • 238
garrettb
  • 139
  • 11
  • AFAIK, there are no projects in VSCode, only "workspaces" and plain folders. I can be wrong though. Maybe you mean Visual Studio (without "code")? – Parzh from Ukraine May 16 '23 at 19:38
  • @ParzhfromUkraine their version number is the current VS Code latest, so not Visual Studio (but that was a legitimately good guess based on their wrong usage of "project" terminology). – starball May 16 '23 at 19:44
  • 1) re: "_so that any dependencies etc, refer to the new project, and not the original?_" - do you mean "dependents"? Are you talking about things that this project depends upon? Or things that depend upon this project? We're really going to need more info about this part of your question to give you an answer. 2) what is "Nordic"? Can you give us a link to something that shows that it is? – starball May 16 '23 at 19:46
  • use the OS terminal to make a copy. IN the make file adjust any paths needed – rioV8 May 16 '23 at 20:37
  • @rioV8 if their project is depended _upon_ by other things, (I'm pending on more clarification on their "_dependencies etc, refer to the new project, and not the original_" statement) it would be more complicated than that. – starball May 16 '23 at 21:28
  • Ok - I am not describing the problem correctly - I am reasonably new to this. I have a project, created from a Nordic Semiconductor project example - it builds etc. If I copy this project folder, in Windows Explorer, and rename it, then open this copy, via the "Open an existing application", the new project is still linked to the original project. For example, in the new/copy project, if I open main.c and edit it, I am actually editing the main.c from the original project. So there must be one or two project files that refer to file location etc. – garrettb May 16 '23 at 21:49
  • is the `main.c` in the copy project some kind of linked file, open the properties in the Windows Explorer for that file (Right Click) – rioV8 May 17 '23 at 03:03
  • 1) can you please provide a link to this example project's repository? 2) what buildsystem are you using to do the build? 3) answers go in answer posts (see [answer]- not in question posts. please write an answer post with the solution you found (but I'm interested in digging deeper and finding out the cause to write a better answer)) – starball May 19 '23 at 19:53

0 Answers0