2017-05-02 52 views
0

我使用zlib庫文件在Android JNI,但我面對這個問題時,我建:未定義的引用進行解壓縮的zlib的Android JNI

undefined reference to uncompress 

我包括zlib.h & zconf.h這裏是我CMakeList.txt

cmake_minimum_required(VERSION 3.4.1) 

add_library(core SHARED 
     foo1.c 
     foo2.c) 

# Include libraries needed for core lib 
target_link_libraries(core 
        android 
        zlib) 

任何人都可以請告訴我發生了什麼事?謝謝 !

回答

2

通過在target_link_librarieszCMakeList

解決現在是這樣的:

cmake_minimum_required(VERSION 3.4.1) 

add_library(core SHARED 
    foo1.c 
    foo2.c) 

# Include libraries needed for core lib 
target_link_libraries(core 
        android 
        z)