Compiling libjpeg

前端 未结 6 1785
情话喂你
情话喂你 2020-11-29 04:07

Is there anyone who succeed to include libjpeg in some compiler? I tried everything: Dev C++, VS10, CodeBlocks, copy the headers and the lib by hand, add with the linker but

6条回答
  •  死守一世寂寞
    2020-11-29 04:36

    If you don't happen to have Visual Studio 2010 installed, here is what works on Visual Studio 2017:

    Basic / Common steps:

    1. Download the latest version of libjpeg from: http://www.ijg.org/ (zip version) and extract it to a folder
    2. Open the "Developer Command Prompt for VS2017"
    3. Change directory (cd) to where you extracted the library source

    VS 2017 Approach:

    1. Include the Windows SDK v7.1A directory (required for Win32.Mak by nmake later on) by running: set INCLUDE=%INCLUDE%;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include

    2. Run nmake /f makefile.win setup-v15 (note the v15 for VS2017 here)

    From here on follow what @AthanasiusOfAlex explained to upgrade the Visual Studio 2010 solution to the Visual Studio version you are running. If you want the Debug configuration, follow what @SteveEng explained.

    Errors you might stumble across:

    • If nmake fails and tells you it doesn't know how to make jconfig.h, manually rename the file jconfig.vc to jconfig.h
    • If nmake fails and tells you Win32.Mak cannot be found, manually copy it from the SDK dir mentioned in step #4 to the libjpeg source directory. If you don't happen to have that SDK version installed, download the file from a trustworthy resource.
    • If nmake fails and tells you it doesn't know how to make setup-v15, trial and error your way through starting with setup-v10, setup-v11, etc... These are VS versions and one of them should work as long as you have any VS version later than VS 2008 installed.

    Hope this helps people going through similar pain with this.

提交回复
热议问题