如何在Android.mk中定义压缩和解压缩的引用

时间:2012-02-16 06:47:31

标签: android android-ndk

我正在尝试在Android下编译C程序。但是我在链接时会'压缩''解压缩':

prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/passion/obj/EXECUTABLES/androidvncserver_intermediates/LibVNCServer-0.9.7/libvncserver/rfbserver.o: in function rfbSendFileTransferChunk:external/android-vnc-server-read-only/LibVNCServer-0.9.7/libvncserver/rfbserver.c:1364: error: undefined reference to 'compress'
prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/passion/obj/EXECUTABLES/androidvncserver_intermediates/LibVNCServer-0.9.7/libvncserver/rfbserver.o: in function rfbProcessFileTransfer:external/android-vnc-server-read-only/LibVNCServer-0.9.7/libvncserver/rfbserver.c:1626: error: undefined reference to 'uncompress'

我已经在Android.mk中添加了

LOCAL_SHARED_LIBRARIES := libz
LOCAL_SHARED_LIBRARIES := libjpeg

LOCAL_MODULE:= androidvncserver
LOCAL_MODULE_TAGS := optional

LOCAL_LDLIBS := -lz

请让我知道我错过了什么:

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
    fbvncserver.c \
    LibVNCServer-0.9.7/libvncserver/main.c \
    LibVNCServer-0.9.7/libvncserver/rfbserver.c \
    LibVNCServer-0.9.7/libvncserver/rfbregion.c \
    LibVNCServer-0.9.7/libvncserver/auth.c \
    LibVNCServer-0.9.7/libvncserver/sockets.c \
    LibVNCServer-0.9.7/libvncserver/stats.c \
    LibVNCServer-0.9.7/libvncserver/corre.c \
    LibVNCServer-0.9.7/libvncserver/hextile.c \
    LibVNCServer-0.9.7/libvncserver/rre.c \
    LibVNCServer-0.9.7/libvncserver/translate.c \
    LibVNCServer-0.9.7/libvncserver/cutpaste.c \
    LibVNCServer-0.9.7/libvncserver/httpd.c \
    LibVNCServer-0.9.7/libvncserver/cursor.c \
    LibVNCServer-0.9.7/libvncserver/font.c \
    LibVNCServer-0.9.7/libvncserver/draw.c \
    LibVNCServer-0.9.7/libvncserver/selbox.c \
    LibVNCServer-0.9.7/libvncserver/d3des.c \
    LibVNCServer-0.9.7/libvncserver/vncauth.c \
    LibVNCServer-0.9.7/libvncserver/cargs.c \
    LibVNCServer-0.9.7/libvncserver/minilzo.c \
    LibVNCServer-0.9.7/libvncserver/ultra.c \
    LibVNCServer-0.9.7/libvncserver/scale.c \
    LibVNCServer-0.9.7/libvncserver/zlib.c \
    LibVNCServer-0.9.7/libvncserver/zrle.c \
    LibVNCServer-0.9.7/libvncserver/zrleoutstream.c \
    LibVNCServer-0.9.7/libvncserver/zrlepalettehelper.c \
    LibVNCServer-0.9.7/libvncserver/zywrletemplate.c \
    LibVNCServer-0.9.7/libvncserver/tight.c

LOCAL_C_INCLUDES := \
    $(LOCAL_PATH) \
    $(LOCAL_PATH)/LibVNCServer-0.9.7/libvncserver \
    $(LOCAL_PATH)/LibVNCServer-0.9.7 \
    external/zlib \
    external/jpeg

LOCAL_SHARED_LIBRARIES := libz
LOCAL_SHARED_LIBRARIES := libjpeg

LOCAL_MODULE:= androidvncserver
LOCAL_MODULE_TAGS := optional

LOCAL_LDLIBS := -lz
include $(BUILD_EXECUTABLE)

1 个答案:

答案 0 :(得分:0)

我通常以下列方式做: 尝试查看rfbserver.c到第1364行。尝试在那里找到'compress'和这个变量的定义(或像这样的宏或smth)。然后尝试在包含文件中找到此变量的定义。当你发现它们将这个文件包含在项目中时。