【Linux开发】Linux下jpeglib库的安装详解
Linux下jpeglib庫的安裝詳解
首先要下載所需的庫壓縮包:jpegsrc.v6b.tar.gz或 jpegsrc.v8b.tar.gz
然后將下載的壓縮包隨便放在和解壓到你喜歡的地方。
# tar -zxvf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure??--enable-shared?
# make
/以下代碼是在usr/local目錄下建立庫文件安裝目錄
/如果沒有權(quán)限建立輸入命令sudo –s 回車,然后按提示輸入你的登錄密碼
# mkdir /usr/local/jpeg6
# mkdir /usr/local/jpeg6/include
# mkdir /usr/local/jpeg6/lib
# mkdir /usr/local/jpeg6/bin
# mkdir /usr/local/jpeg6/man
# mkdir /usr/local/jpeg6/man/man1
# make install
#----configuration information----
echo "---------------------------------------------------------------------"
echo "please add following lines in you /etc/profile"
echo "("
echo " tip:"
echo " you can add these lines in a file named /etc/profile.jpeg,"
echo " and then add a line on the end of /etc/profile:"
echo " . /etc/profile.jpeg"
echo " it is simple,:)"
echo "):"
echo " PATH=""$""PATH:$jpeg/bin"
echo " CPLUS_INCLUDE_PATH=""$""CPLUS_INCLUDE_PATH:$jpeg/include"
echo " LD_LIBRARY_PATH=""$""LD_LIBRARY_PATH:$jpeg/lib"
echo " LIBRARY_PATH=""$""LIBRARY_PATH:$jpeg/lib"
echo " MANPATH=""$""MANPATH:$jpeg/man"
echo ""
echo " export PATH CPLUS_INCLUDE_PATH LD_LIBRARY_PATH LIBRARY_PATH MANPATH"
這就安裝完了嗎???no!!!
你可能在編譯自己寫的程序的時候會遇到一下問題終端提示
/tmp/cc9DqMJZ.o: In function `jpeg_compress':
server1214.c:(.text+0x4f5): undefined reference to `jpeg_std_error'
server1214.c:(.text+0x519): undefined reference to `jpeg_CreateCompress'
server1214.c:(.text+0x59b): undefined reference to `jpeg_stdio_dest'
server1214.c:(.text+0x5d1): undefined reference to `jpeg_set_defaults'
server1214.c:(.text+0x5ef): undefined reference to `jpeg_set_quality'
server1214.c:(.text+0x605): undefined reference to `jpeg_start_compress'
server1214.c:(.text+0x64c): undefined reference to `jpeg_write_scanlines'
server1214.c:(.text+0x66a): undefined reference to `jpeg_finish_compress'
server1214.c:(.text+0x686): undefined reference to `jpeg_destroy_compress'
collect2: ld 返回 1
?
解決辦法在編譯命令后加-ljpeg
例 gcc –o **** ****.c –ljpeg
Ok?成功!!!!
轉(zhuǎn)載于:https://www.cnblogs.com/huty/p/8518211.html
總結(jié)
以上是生活随笔為你收集整理的【Linux开发】Linux下jpeglib库的安装详解的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Oracle Primavera P6
- 下一篇: SQL学习之使用视图