linking against libpng_static

Hi,

I am trying to write a c file to decompress jpeg images in android aokp source

Sample from my c code:
1
2
3
4
5
6
7
8
9
...
#include "jpeglib.h"
...

int main() {
    struct jpeg_decompress_struct cinfo;
    struct jpeg_error_mgr jerr;
    cinfo.err = jpeg_std_error(&jerr);
    jpeg_create_decompress(&cinfo);


Android.mk
1
2
3
4
LOCAL_C_INCLUDES += \
    external/jpeg

LOCAL_STATIC_LIBRARIES += libjpeg_static


libjpeg source I am using:
https://github.com/CyanogenMod/android_external_jpeg

Compiling goes fine, but the linker always fails:
1
2
undefined reference to 'jpeg_std_error'
undefined reference to 'jpeg_CreateDecompress'


Any idea how can I get it working?
Humm
Tried include header with extern, adding manually local flag -ljpeg_static
I also removed the define for short names and even the EXTERN from erroring functions in jpeglib.h, no way...

I see libjpeg such errors are frequent in google search, but nothing about android...
Topic archived. No new replies allowed.