I'm building a dynamic library c which is linked to a static library b.
The static library b is statically linked to the static library a.
The cmake for c, roughly looks like this (the cmakes for a and b are quite similar):
cmake_minimum_required(VERSION 2.6)
project(c)
include_directories(../b/src)
link_directories(../b/Debug)
add_library(c SHARED src/c.cpp)
target_link_libraries(c PRIVATE b)
The issue I'm facing is related to the fact that c can't see references to functions defined in a:
b.lib(b.obj) : error LNK2019: unresolved external symbol "int __cdecl a(void)" (?a@@YAHXZ) referenced in function "int __cdecl b(void)" (?b@@YAHXZ) [C:\Users\user\Workspace\garbage\c\c.vcxproj]
C:\Users\user\Workspace\garbage\c\Debug\c.dll : fatal error LNK1120: 1 unresolved externals [C:\Users\user\Workspace\garbage\c\c.vcxproj]
Is there any way for c to properly link?
Related questions: