Hi, <br><br>I&#39;m trying to create some static libraries that i used in an android application.<br><br>In a first part, I&#39;ve created my A static library. This library is functionnal.<br>I have trying to link this library A into the build of a second library, the B static library, <br>
with the command :<br><br>add_library(A STATIC IMPORTED)<br>set_target_properties(A PROPERTIES IMPORTED_LOCATION ${A_LIBRARY_PATH})<br><br>add_library(B STATIC ${source_files})<br>target_link_libraries(B A )<br><br>But I try another way to link the static library with a roof&#39;s CMakeList.txt, who called the A&#39;s CMakeLists.txt and the B&#39;CMakeLists.txt.<br>
<br>There is the code :<br><br><u>ROOF&#39;S CMAKELIST.TXT </u><br><br>CMAKE_MINIMUM_REQUIRED(VERSION 2.8)<br><br>project(main)<br><br>INCLUDE_DIRECTORIES(A/src/A/lib)<br>INCLUDE_DIRECTORIES(B/src/ B/lib)<br><br>add_subdirectory(A/proj/eclipse/debug_android/cmake/ A/lib)<br>
add_subdirectory(B/proj/eclipse/debug_android/cmake-B/ B/lib)<br><br><u>A&#39;S CMAKELIST.TXT </u><br><br>cmake_minimum_required(VERSION 2.8)<br><br>project(A)<br><br>#notice the &quot;recycling&quot; of CMAKE_C_FLAGS<br>
#this is necessary to pick up android flags<br>set( CMAKE_C_FLAGS &quot;${CMAKE_C_FLAGS} -Wall -pedantic&quot; )<br><br>include_directories(${AS_WORKSPACE}/pkg/extern/src/)<br>include_directories(${AS_WORKSPACE}/pkg/A/src/)<br>
include_directories(${PROJECT_SOURCES})<br>file(<br>    GLOB_RECURSE<br>    source_files<br>    ${PROJECT_SOURCES}/*.cpp<br>    ${PROJECT_SOURCES}/*.h<br>)<br><br>add_library(A STATIC ${source_files} )<br><br><u>B&#39;S CMAKELIST.TXT </u><br>
<br>cmake_minimum_required(VERSION 2.8)<br><br>project(B)<br><br>#notice the &quot;recycling&quot; of CMAKE_C_FLAGS<br>#this is necessary to pick up android flags<br>set( CMAKE_C_FLAGS &quot;${CMAKE_C_FLAGS} -Wall -pedantic&quot; )<br>
set( JNI_INCLUDE_DIRS ${LIBRARY_OUTPUT_PATH_ROOT}/jni )<br><br>include_directories(${PROJECT_SOURCES}/../../pkg/extern/src/)<br>include_directories(${PROJECT_SOURCES}/../../A/src/)<br>include_directories(${PROJECT_SOURCES})<br>
file(<br>    GLOB_RECURSE<br>    source_files<br>    ${PROJECT_SOURCES}/*.cpp<br>    ${PROJECT_SOURCES}/*.h<br>)<br><br>set(A_LIBRARY_PATH /home/gbadoual/Workspace//libA.a)<br><br>add_library(B STATIC ${source_files})<br>
target_link_libraries(B A)<br><br><br>And the android-toolchain.cmake that i call to create theses libraries is provided by <a href="http://code.google.com/p/android-cmake/">http://code.google.com/p/android-cmake/</a>, that i have changed for my project.<br>
<br>I have no errors in the compilation<br>but when i launch my android application, he recognize my A library, and my B library.<br>But the B library don&#39;t recognize the A library. This B library is not well linked with A<br>
<br>I have with no doubt misunderstanding something, in this linking.<br>Anyone can help me to fix this problem ?<br><br>