I have the following structure of my projects:
The .la file is created using the *.c source files in the lib folder of Project2 using libtool.
I need to link the .la file in one of the cpp files present in the Project1/src/samples/.
I have already tried the following in CmakeLists.txt present in Project1/src/samples:
add_executable(source_file source_file.cpp)
target_link_library(source_file ${LOCATION_OF_.LA_FILE})
CMakeLists.txt is present in
Every time I make the Project1's source_file I get the following linker error "Undefined reference to fun()
"
where, fun() is defined in one of the c files present in Project1/src/Project2/lib/.
Any ideas what is the problem and how to link the .la of Project2 in Project1. Or is there a way I can include the *.c files from Project2/lib's folder in the CMakeLists.txt of Project1's samples folder?