在PC上使用:
下载libjpeg安装包。在解压目录下执行一下指令。
./configure
./make
./make install
执行完这个指令之后,它会将生成的库文件,输出到 /usr/local/lib
拷贝 jconfig.h jmorecfg.h jpeglib.h 三个头文件到 /usr/include
这样就可以直接在程序中ljpeg的库
头文件加上 #include <jpeglib.h>
在编译时加上 -ljpeg
交叉编译使用:
在源代码的解压目录下执行下列指令:
#./configure --prefix=/usr/local/lib --host=arm-linux CC=arm-linux-gnueabihf-gcc --enable-shared --enable-static
##说明 :prefix库输出的位置 --host:交叉编译 CC=交叉编译器的名字 编译动态库 编译静态库文件
./make
./make install
将交叉编译的库文件放在开发板的对应目录下 /usr/lib下
头文件放在开发板的对应目录下 /usr/include/下
这样使用libjpeg交叉编译的程序就可以直接拷贝到板子上面运行了