如何在vs中导入libjpeg_libjpeg在vs2010下编译

1、第一步当然是先下载源码了,下载地址:http://www.ijg.org/

2、解压后所有的东西都在一个文件夹里了,如果有耐心可以看一下自带的说明文档(install.txt)

3、其中有一段在vs2010下的说明

==================================================================

Microsoft Windows, Microsoft Visual C++ 2010 Developer Studio (v10):

We include makefiles that should work as project files in Visual Studio2010 or later.  There is a library makefile that builds the IJG library

as a static Win32 library, and application makefiles that build the sample applications as Win32 console applications.  (Even if you only want the

library, we recommend building the applications so that you can run the self-test.)

To use:

1. Open the command prompt, change to the main directory and execute the  command line

NMAKE/f makefile.vc  setup-v10

This 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.

(If you are using Visual Studio more recent than 2010 (v10), you'll  probably get a message saying that the project files are being updated.)

3. Open the solution file apps.sln, build the application projects.

4. To perform the self-test, execute the command line

NMAKE/f makefile.vc  test-build

5. Move the application .exe files from `app`\Release to an   appropriate location on your path.

Note:

There seems to be an optimization bug in the compiler which causes the self-test to fail with the color quantization option.

We have disabled optimization for the file jquant2.c in the library project file which causes the self-test to pass properly.

=============================================================================================

简单的操作其实也就两行,一个是生成vs2010的工程文件 NMAKE /f makefile.vc  setup-v10

运行结果如下:

Microsoft (R) Program Maintenance Utility Version9.00.30729.01Copyright (C) Microsoft Corporation.  All rights reserved.

        ren jconfig.vc jconfig.h

        ren makejsln.v10 jpeg.sln

        ren makeasln.v10 apps.sln

        ren makejvcx.v10 jpeg.vcxproj

        ren makejfil.v10 jpeg.vcxproj.filters

        ren makecvcx.v10 cjpeg.vcxproj

        ren makecfil.v10 cjpeg.vcxproj.filters

        ren makedvcx.v10 djpeg.vcxproj

        ren makedfil.v10 djpeg.vcxproj.filters

        ren maketvcx.v10 jpegtran.vcxproj

        ren maketfil.v10 jpegtran.vcxproj.filters

        ren makervcx.v10 rdjpgcom.vcxproj

        ren makerfil.v10 rdjpgcom.vcxproj.filters

        ren makewvcx.v10 wrjpgcom.vcxproj

        ren makewfil.v10 wrjpgcom.vcxproj.filters

然后打开jpeg.sln,直接编译就ok了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值