Cmake install nested static library target_link_library undefined reference
Advertisements Install nested static library, and target_link_library not working File structure: HelloLib WorldLib CMakeLists.txt WorldLib.cpp WorldLib.h CMakeLists.txt HelloLib.cpp HelloLib.h CMakeLists.txt main.cpp main.cpp #include <iostream> #include "HelloLib/HelloLib.h" int main() { std::cout << hello() << std::endl; return 0; } CMakeLists.txt (root) cmake_minimum_required(VERSION 3.16.3) project(HelloWorld) add_executable(${PROJECT_NAME} main.cpp) add_subdirectory(HelloLib) target_link_libraries( ${PROJECT_NAME} HelloLib ) HelloLib.cpp #include <string> #include "WorldLib/WorldLib.h" std::string… Read More Cmake install nested static library target_link_library undefined reference