Qt君最近在做图像相关的项目,用到了libjpeg库。记录libjpeg编译步骤供大家参考。

1.下载源码(jpegsrc9c.zip)

  • 官网地址:
http://www.ijg.org/

  • jepgsrc9c.zip源码包下载地址:
http://www.ijg.org/files/jpegsr9c.zip
  • 如上的下载地址失效可以使用Qt君的github仓库下载:
https://github.com/aeagean/LibjpegForWindows/blob/master/jpeg-9c/jpegsr9c.zip

2.如何找到编译配置方法?

  下载的源码中有一个编译安装教程文件(install.txt)

  • install.txt中摘取的VC++6配置编译方法:
Microsoft Windows, Microsoft Visual C++ 6 Developer Studio:To use:
1. Open the command prompt, change to the main directory and execute thecommand lineNMAKE /f makefile.vs  setup-vc6This will move jconfig.vc to jconfig.h and makefiles to project files.(Note that the renaming is critical!)
2. Open the workspace file jpeg.dsw, build the library project.(If you are using Developer Studio more recent than 6.0, you'llprobably get a message saying that the project files are being updated.)
3. Open the workspace file apps.dsw, build the application projects.
4. To perform the self-test, execute the command lineNMAKE /f makefile.vs  test-build
5. Move the application .exe files from `app`\Release to anappropriate location on your path.
  • install.txt中摘取的VS2017配置编译方法:
Microsoft Windows, Visual Studio 2017 (v15):To use:
1. Open the Developer Command Prompt, change to the main directory andexecute the command lineNMAKE /f makefile.vs  setup-v15This will move jconfig.vc to jconfig.h and makefiles to project files.(Note that the renaming is critical!)
2. Open the solution file jpeg.sln, build the library project.a) If you are using Visual Studio more recent than2017 (v15), you'll probably get a message sayingthat the project files are being updated.b) If necessary, open the project properties andadapt the Windows Target Platform Version inthe Configuration Properties, General section;we support the latest version at the time of release.
3. Open the solution file apps.sln, build the application projects.
4. To perform the self-test, execute the command lineNMAKE /f makefile.vs  test-build
5. Move the application .exe files from `app`\Release to anappropriate location on your path.

3.以编译VS2017版本为例

  由于VC++6的编译方法与VS2017方法基本相同,这里使用VS2017的编译环境编译。

3.1 编译步骤

1. 打开VS2017开发者终端,主要是使用VS2017的开发环境。

2. 进入libjpeg库目录,使用NMAKE命令生成VS2017的项目文件(用于编译libjpeg库)。

  图示

  命令

NMAKE /f makefile.vs setup-v15

  这一步可能遇到的问题:如果出现以下情况,可能是你重复调用命令生成,导致文件不能重命名,或你修改了里面的一些文件名字。建议重新解压libjpeg库再执行命令生成。

3. 打开libjpeg库目录的jpeg.sln项目文件。

  这一步可能遇到的问题

jpeg.vcxproj.filters : warning  : 无法读取筛选器文件“jpeg.vcxproj.filters”。请卸载项目“jpeg.vcxproj”以便对其进行编辑。
jpeg.vcxproj.filters(1,1): 未能加载项目文件。根级别上的数据无效。 第 1 行,位置 1。

  解决方法

  • 使用记事本打开jpeg.vcxproj删除第1行的第1个位置的乱码字符
  • 另存为UTF-8格式并覆盖jpeg.vcxproj文件。
  • 相似的问题可以使用同样的方法解决。

4. 编译

  这一步可能遇到的问题

  • Windows SDK版本不匹配的问题。

  解决方法:修改Windows SDK版本:

  • 提示必须定义入口点的问题:

  解决方法:设置动态库静态库

3.2 最后编译成功

4.打包好的库和头文件

  • 仅供学习使用。
  • 32位与64位的release版本静态库。
  • 地址:
https://github.com/aeagean/LibjpegForWindows

Windows编译libjpeg库相关推荐

  1. VS2013编译libjpeg库

    现在,很多图像处理工具和开源库都给出了图像解码的函数接口,然而有时这些接口并不能完全满足我们的需求,比如如果我们想直接去解码内存中的JPEG数据就没有这样的接口. 由于之前做的项目刚刚好设备传过来的图 ...

  2. 在Windows下使用vs2019编译libjpeg库

    一.库的编译 1.下载 libjpeg 源码,这里我下载的是 jpegsr9e.zip 2.解压源码 3.进入解压后的目录,找到 makefile.vs 文件,用文本编辑器打开并编辑,找到 语句 #! ...

  3. VS2015编译libjpeg库

    参考资料: 1.http://blog.csdn.net/joeblackzqq/article/details/42264143 2.http://www.cnblogs.com/summerRQ/ ...

  4. 【Android 逆向】Android 逆向通用工具开发 ( Windows 平台静态库程序类型 | 编译逆向工具依赖的 Windows 平台静态库程序 )

    文章目录 一.Windows 平台静态库程序类型 二.编译逆向工具依赖的 Windows 平台静态库程序 一.Windows 平台静态库程序类型 在 Android 逆向通用工具 MobileGame ...

  5. Windows下编译openssl库

    1.概述 OpenSSL是一个开放源代码的软件库包,它实现了 SSL(Secure SocketLayer)和 TLS(Transport Layer Security)协议,所以应用程序可以使用这个 ...

  6. Android直播开发之旅(15):libjpeg库的编译移植与使用

    1. libjpeg介绍  libJPEG库是一款功能强大的JPEG图像处理开源库,它支持将图像数据压缩编码为JPEG格式和对原有的JPEG图像解压缩,Android系统底层处理图片压缩就是用得lib ...

  7. 在windows上编译apr库apr-util库

    在windows上编译apr库apr-util库 环境: win10.VS2015企业版.CMake3.18.2 一.下载apr相关库 1.1)expat:expat-2.1.0.tar.gz 1.2 ...

  8. Windows下编译boost库

    需要编译的boost库 以下的库必须单独编译: Boost.Chrono Boost.System Boost.Context Boost.ProgramOptions Boost.Filesyste ...

  9. windows下编译libzip库

    源码 编译libzip需要依赖zlib的库 zlib和libzip的git代码: https://github.com/madler/zlib.git https://github.com/nih-a ...

最新文章

  1. python 获取打印的内容并保存到记事本里面
  2. Radar Installation(贪心,sort)
  3. mysql中RAND()随便查询记录效率问题和解决的方法分享
  4. 指针增量和数组的关系,指针偏移的补充,(重要面试),gdp调试,将数组中的n个元素逆序存放
  5. Halcon初学者知识【19】带paint_的系列算子
  6. Kafka入门教程(转载)
  7. Springmvc的服务端数据验证-----Hibernate Validator
  8. 数据结构——图——最短路径DF算法
  9. mysql错误18456_【问题解决】SQL2008 SQL Server身份认证方式登录失败(错误18456)解决方法图解...
  10. mybatis plug 只查id_Mybatis一对多/多对多查询时只查出了一条数据
  11. GraphX主要的接口详解
  12. 解决一个用Idea的Docker插件远程部署SpringBoot的失败问题
  13. websoc是什么可以卸载吗_购房诚意金是什么意思?可以退吗?
  14. 给Execl样式添加配置文件.
  15. sql linux 160天,Ubuntu下用脚本执行sql语句(sqlite)
  16. 敏捷开发基础篇(一)-流程与角色基本概念
  17. 支持异步通知的globalfifo平台设备驱动程序及其测试代码
  18. 根据当前节点获取所有上层结构的组织(递归算法)
  19. Spark入门(一篇就够了)
  20. Kotlin中单利常用的五种写法

热门文章

  1. 基于labview的小波去噪算法及传统去噪算法性能的对比分析
  2. 语义分割之 标签生成
  3. php 相同数据合并单元格,elementUI table合并相同数据的单元格
  4. 计算机网络网桥思维导图,《王道计算机网络》学习笔记总目录+思维导图
  5. 如何写好科研论文 | 讨论
  6. jquery ui放大缩小_jQuery UI 实例
  7. 2022年塑料管材市场规模
  8. 数学建模----图与网络模型
  9. android面试(个人)简历
  10. 快讯:中粮联手维维出资1亿元设立置业公司