请问一下,我在编译二进制程序的时候,报一下错误:
.../libcutils.so: undefined reference to `ioprio_set'
.../libsurfaceflinger.so: undefined reference to `pthread_cond_timedwait_relative_np'
.../libsurfaceflinger_client.so: undefined reference to `pthread_condattr_destroy'
.../libsurfaceflinger_client.so: undefined reference to `pthread_condattr_setpshared'
.../libcutils.so: undefined reference to `ioprio_get'                                  
.../libsurfaceflinger_client.so: undefined reference to `pthread_condattr_init'
我的makefile文件中
LIBS += log z m stdc++ c dlLIBS += cutils \
        utils \
        binder \
        netutils \
        ui \
        surfaceflinger \
        EGL \
        GLESv1_CM \
        GLESv2 \
        hardware \
        hardware_legacy \
        wpa_client \
        pixelflinger在android源代码中bionic中有这些函数的定义和声明,奇怪为什么这些报未定义了?

解决方案 »

  1.   

    定位到了,由于我同时包含了android-ndk-r4-crystax\build\platforms\android-8\arch-arm\usr\lib 和手机系统的库目录,在链接的时候,编译器首先链接了android-ndk-r4-crystax下的libc.so导致出现以上错误。
      

  2.   

    可以通过nm或者objdump导出原有lib的符号表,然后找到对应的lib