<div dir="ltr"><div>Hi Richard,</div><div><br></div><div>does it help if you specify the linking as PUBLIC? I.e.:</div><div><br></div><div>
target_link_libraries(second_object_lib PUBLIC first_object_lib)</div><div><br></div><div>Petr<br>

</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 22 May 2019 at 07:48, Richard Szabo <<a href="mailto:sz.richard@gmail.com">sz.richard@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi cmakers<br>
<br>
I'm trying to get the following example working:<br>
```<br>
cmake_minimum_required(VERSION 3.14)<br>
project(test_object_lib_nesting)<br>
<br>
set(CMAKE_CXX_STANDARD 14)<br>
<br>
add_library(first_object_lib OBJECT first.cpp)<br>
<br>
add_library(second_object_lib OBJECT second.cpp)<br>
<br>
target_link_libraries(second_object_lib first_object_lib)<br>
<br>
add_executable(test_object_lib_nesting main.cpp)<br>
<br>
target_link_libraries(test_object_lib_nesting second_object_lib)<br>
```<br>
<br>
The problem I have that the linker command line will have only the<br>
second.cpp.o for linking the first.cpp.o will not be added as link<br>
object to the exe. Causing missing symbols on exe linkage.<br>
<br>
How to transitively resolve and link "nested" Object library targets ?.<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div>