Hello,
I used the simplest/stupidest way to do the version control by naming programs like Foo_V1 and Foo_V2. But along with more and more projects and more and more versions, my "Program Workspace" is a mess.
I tried to use "sub-folders" for the version control like
However, the compiler will compile the both main.cpp files in V1 and V2, and complains multiple defined functions.
To work around this, I modify the main.cpp in V1 and V2 as
main.cpp in V1
#include "version.h"
#ifdef V1
#include "mbed.h"
.....
.....
.....
#endif
and
main.cpp in V2
#include "version.h"
#ifdef V2
#include "mbed.h"
.....
.....
.....
#endif
Then add a version.h to define the version V1 or V2
#define V1
The work-around works. But I am wondering if there is more straight forward, elegant way to do the version control?
Best regards,
Paul
Hello,
I used the simplest/stupidest way to do the version control by naming programs like Foo_V1 and Foo_V2. But along with more and more projects and more and more versions, my "Program Workspace" is a mess.
I tried to use "sub-folders" for the version control like
However, the compiler will compile the both main.cpp files in V1 and V2, and complains multiple defined functions.
To work around this, I modify the main.cpp in V1 and V2 as
and
Then add a version.h to define the version V1 or V2
The work-around works. But I am wondering if there is more straight forward, elegant way to do the version control?
Best regards,
Paul