#在测试文件夹下建立目录 jpegtest
cd /data/mac
mkdir jpegtest
#在jpegtest下建立 include libs目录用于存储 libjpeg-turto相关库文件和头文件
cd jpegtest
mkdir include
mkdir libs
#拷贝之前编译好的libjpeg-turto 库文件到libs
cd libs
cp ../../libjpeg-turbo-1.5.3/.libs/* ./
#拷贝头文件到include
cd ..
cd include
cp ../../libjpeg-turbo-1.5.3/*.h ./
cd ..
#在jpegtest目录下编写 myjpeg.h myjpeg.c文件 然后生成.a
#此处忽略myjpeg.c myjpeg.h编写过程,编写完成后执行下面操作
//myjpeg.h
#ifndef __MYJPEG_H__
#define __MYJPEG_H__
#if defined(_WIN32) && defined(DLLDEFINE)
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT
#endif
#define DLLCALL
#ifdef __cplusplus
extern "C" {
#endif
DLLEXPORT int DLLCALL myJpeg2Yuv(unsigned char* compressedImage,long unsigned int jpegSize, unsigned char **dstBuf, unsigned long int *yuvSize);
#ifdef __cplusplus
}
#endif
#endif