T
thomas
Hi,
I have a header file like this:
-------------------MyStruct.h---------
struct MyStruct{
void method1();
};
------------------MyStruct.cpp----------
void MyStruct::method1(){}
Now I will use MyStruct in several projects.
Definitely I will include "MyStruct.h" in each project.
But I don't know how to handle "MyStruct.cpp".
I think there are several options:
1. compile MyStruct.cpp in a library, link it when building other
projects.
But there is only one "cpp", it seems over-kill.
2. compile MyStruct.cpp in one of the project, link the project when
building other projects.
But it seems ugly. There's no obvious dependence between the projects.
3. put one copy of MyStruct.cpp in each project.
It's obviously ugly as to maintenance difficulty.
Now I want to hear your suggestions, thanks.
I have a header file like this:
-------------------MyStruct.h---------
struct MyStruct{
void method1();
};
------------------MyStruct.cpp----------
void MyStruct::method1(){}
Now I will use MyStruct in several projects.
Definitely I will include "MyStruct.h" in each project.
But I don't know how to handle "MyStruct.cpp".
I think there are several options:
1. compile MyStruct.cpp in a library, link it when building other
projects.
But there is only one "cpp", it seems over-kill.
2. compile MyStruct.cpp in one of the project, link the project when
building other projects.
But it seems ugly. There's no obvious dependence between the projects.
3. put one copy of MyStruct.cpp in each project.
It's obviously ugly as to maintenance difficulty.
Now I want to hear your suggestions, thanks.