Workspace/
common_files/
common_file.h
void common_function(void);
common_file.cpp
void common_function(void) { printf("do something\n"); }
Project_A/
main.cpp
CMakeLists.txt
mbed-os/
Project_B/
main.cpp
CMakeLists.txt
mbed-os/
Using the above example Mbed Studio workspace structure, how would I go about including common_file.h
into Project_a/main.cpp
?
When I include "../common_files/common_file.h"
in Project_A/main.cpp
and call common_function();
, I get a linker error stating that there is an undefined reference to common_function();
.