question about create a library
Hi,
I want to create a library that used as a third party and can be installed and find_package(). I process on according to the tutorial edited by Kitware Robot. After installing my library, I build a test program to include the library and call the API.
#include <iostream>
#include "library/library1.h"
#include "library/library2.h"
using namespace std;
int main() {
hello();//defineded in library1.h
helloz();//definded in library2.h
}
If I put the #include "library/library1.h"
before the #include "library/library2.h"
.
helloz();//definded in library2.h
can't run, error occur:
error: ‘helloz’ was not declared in this scope helloz();
If I put the #include "library/library2.h"
before the #include "library/library1.h"
.
hello();//defineded in library1.h
can't run, error occur:
error: ‘hello’ was not declared in this scope hello();
My project file is in the link. Can you give me some advice? Thanks a lot.
Edited by TouchDeeper