Duplicating projects and unupdated code

hi,

wondering if anyone has any issues when they duplicate projects… i find that when i duplicate projects and continue working on one version, the code in my xcode windows is not the same code saved in the src folder. i can save, close and reopen projects and the code is updated, but remains reverted in the src folder, which leads to ghost errors.

is there a way to prevent this other than what i have been doing, which is to manually copy and paste the code from my live windows into the src folder files?

thanks in advance.

01

Usually people duplicates the entire folder in order to duplicate a project. Duplicating only the project file might lead to unexpected behavior (unless you know what you are doing…) but for sure it is bad to simultaneously work on two project files that point to the same code…

Are you duplicating the folder that contains: the project file, the src folder and bin folder? or only the project file?

hi jordi,

i duplicate the entire folder just as you recommend. one time i duplicated a project and when i made changes to the one i continued to work with, the original changed as well as if they were linked.

Yes. What you experienced is what is expected.
A project file only contains the information on how to build the source files, IDE configuration… and other things. But the the source code is updated (files are saved) every time you compile the project. This means that, if you have two project files compiling the same source, when you hit compile the source will be changed to the latest stage of your current project, then when you move (open or get focus) to the other project, the IDE will ask you to load the source code because it has changed from outside. Sometimes the IDE loads the new source automatically without asking (depends on your config…).

Anyways, the best is to duplicate the folder that contains the project files, source and binaries. Then you will not experience these issues.

but i do duplicate the project folder with the project files, source and binaries and i still experience the strange linking.

can you post a screenshot of your directory tree? I-m not sure I understand what you are doing… do you have only one project file per project folder?

yes. i have one project file for each project:

openframeworks -> apps -> myApps -> a folder for each project