Jpeg-9e源码编译(Win10,VS2022)

本文指导如何从JPEG-9e官网下载源代码,通过Win32.mak文件配置VS2022环境,创建解决方案并生成Release和Debug版本。涉及解压、环境变量设置、编译选项和链接器设置等步骤。

Jpeg-9e源代码下载网址

http://www.ijg.org/

下载后得到文件

解压缩到“D:\SourceCodes\jpeg-9e”

在目录“D:\SourceCodes\jpeg-9e”中创建文本文件,并改名为“win32.mak”,其内容如附注所示。

使用命令行,进入VS2022开发者命令行窗口

cd D:\Programs\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build

D:

vcvars64.bat

 

在文本文件“install.txt”中搜索字符串“Microsoft Windows, Visual Studio 2022 Version 17:”,可以找到在VS2022中创建sln文件的方法。

进入目录“D:\SourceCodes\jpeg-9e”,执行命令“nmake /f makefile.vs setup-v17”,创建VS2022的解决方案“jpeg.sln”。

cd D:\SourceCodes\jpeg-9e

nmake /f makefile.vs setup-v17

 

在目录中,使用VS2022打开文件“jpeg.sln”。

选择Release、X64,成功生成。

 

为了生成debug版,需要新建debug配置(从release复制相关设置,可通过活动解决方案平台删除非x64的配置项):

 

 

 

代码生成运行库设置为 /MDd禁用优化

 

禁用优化

 

预处理器定义,将NDEBUG 改为DEBUG

 

将目标文件名由$(ProjectName)改为$(ProjectName)d

 

即可对Debug版进行编译了。

 

win32.mak的内容如下:

# Win32.Mak - Win32 application master NMAKE definitions file for the
#     Microsoft Windows SDK programming samples
#           Copyright (C) Microsoft Corporation
# -------------------------------------------------------------------------
# This files should be included at the top of all MAKEFILEs as follows:
#  !include <Win32.Mak>
# -------------------------------------------------------------------------
#
# Define APPVER = [ 4.0 | 5.0 | 5.01 | 5.02 | 6.0 | 6.1] prior to including win32.mak to get
#  build time checking for version dependencies and to mark the executable
#  with version information.
#
# Define TARGETOS = [ WIN95 | WINNT | BOTH ] prior to including win32.mak
#  to get some build time checking for platform dependencies.
#
# Define TARGETLANG = [ LANG_JAPANESE | LANG_CHINESE | LANG_KOREAN ] prior
#  to including win32.mak to getcompile & link flags for building
#  applications to run on Far-East Windows. (This is an optional parameter.
#  The system locale is the default.)
#
# Define _WIN32_IE = [ 0x0300 | 0x0400 | 0x0500 | 0x0600 | 0x0700 | 0x0800] prior to including win32.mak to
#  get compile and link flags for building applications and components to
#  run on Internet Explorer. (This is an optional parameter.  IE 4.0 is
#  the default.)
#
# -------------------------------------------------------------------------
# NMAKE Options
#
# Use the 
这是虚拟环境里的包,如果升级python会报错吗,absl-py 2.3.1 accelerate 1.8.1 airsim 1.8.1 annotated-types 0.7.0 antlr4-python3-runtime 4.9.3 anyio 4.9.0 av 15.0.0 black 25.1.0 blas 1.0 brotlicffi 1.0.9.2 bzip2 1.0.8 ca-certificates 2025.2.25 cairo 1.16.0 cccl 2.3.2 certifi 2025.7.9 cffi 1.17.1 chardet 5.2.0 charset-normalizer 3.4.2 click 8.1.8 cloudpickle 3.1.1 colorama 0.4.6 contourpy 1.3.0 cuda-cccl 12.4.127 cuda-cccl_win-64 12.4.127 cuda-cudart 12.4.127 cuda-cudart-dev 12.4.127 cuda-cudart-dev_win-64 12.4.127 cuda-cudart-static 12.4.127 cuda-cudart-static_win-64 12.4.127 cuda-cudart_win-64 12.4.127 cuda-cupti 12.4.127 cuda-libraries 12.4.1 cuda-libraries-dev 12.4.1 cuda-nvrtc 12.4.127 cuda-nvrtc-dev 12.4.127 cuda-nvtx 12.4.127 cuda-opencl 12.4.127 cuda-opencl-dev 12.4.127 cuda-profiler-api 12.4.127 cuda-runtime 12.4.1 cuda-version 12.4 cycler 0.12.1 cython 3.1.2 dav1d 1.2.1 decord 0.6.0 deprecated 1.2.13 detectron2 0.6 distro 1.9.0 exceptiongroup 1.3.0 expat 2.7.1 ffmpeg 6.1.1 filelock 3.18.0 fontconfig 2.14.1 fonttools 4.58.5 freetype 2.13.3 fsspec 2025.5.1 fuzzywuzzy 0.18.0 fvcore 0.1.5.post20221221 giflib 5.2.2 gmp 6.3.0 gmpy2 2.2.1 graphite2 1.3.14 grpcio 1.73.1 h11 0.16.0 h5py 3.14.0 harfbuzz 10.2.0 hf-transfer 0.1.9 httpcore 1.0.9 httpx 0.28.1 huggingface-hub 0.33.4 hydra-core 1.3.2 icu 73.1 idna 3.10 imageio 2.37.0 imgviz 1.7.6 importlib-metadata 8.7.0 importlib-resources 6.5.2 intel-openmp 2023.1.0 iopath 0.1.9 jinja2 3.1.6 jiter 0.10.0 jpeg 9e khronos-opencl-icd-loader 2024.05.08 kiwisolver 1.4.7 lazy-loader 0.4 lcms2 2.16 lerc 3.0 levenshtein 0.27.1 libabseil 20250127.0 libcublas 12.4.5.8 libcublas-dev 12.4.5.8 libcufft 11.2.1.3 libcufft-dev 11.2.1.3 libcurand 10.3.5.147 libcurand-dev 10.3.5.147 libcusolver 11.6.1.9 libcusolver-dev 11.6.1.9 libcusparse 12.3.1.170 libcusparse-dev 12.3.1.170 libdeflate 1.17 libffi 3.4.4 libglib 2.84.2 libiconv 1.16 libjpeg-turbo 2.0.0 libnpp 12.2.5.30 libnpp-dev 12.2.5.30 libnvfatbin 12.4.127 libnvfatbin-dev 12.4.127 libnvjitlink 12.4.127 libnvjitlink-dev 12.4.127 libnvjpeg 12.3.1.117 libnvjpeg-dev 12.3.1.117 libogg 1.3.5 libpng 1.6.39 libprotobuf 5.29.3 libtheora 1.1.1 libtiff 4.5.1 libtorch 2.5.1 libuv 1.48.0 libwebp 1.3.2 libwebp-base 1.3.2 libxml2 2.13.8 lz4-c 1.9.4 markdown 3.8.2 markupsafe 3.0.2 matplotlib 3.9.4 mkl 2023.1.0 mkl-service 2.4.0 mkl_fft 1.3.11 mkl_random 1.2.8 mpc 1.3.1 mpfr 4.2.1 mpmath 1.3.0 msgpack-python 0.5.6 msgpack-rpc-python 0.4.1 mypy-extensions 1.1.0 networkx 3.2.1 numpy 2.0.2 numpy-base 2.0.2 omegaconf 2.3.0 openai 1.95.1 opencv-contrib-python 4.12.0.88 opencv-python 4.12.0.88 opencv-python-headless 4.12.0.88 openjpeg 2.5.2 openssl 3.0.16 opentelemetry-api 1.30.0 orjson 3.11.0 packaging 25.0 pathspec 0.12.1 pcre2 10.42 pillow 11.3.0 pip 25.1 pixman 0.40.0 platformdirs 4.3.8 portalocker 3.2.0 protobuf 6.31.1 psutil 7.0.0 pycocotools 2.0.10 pycparser 2.21 pydantic 2.11.7 pydantic-core 2.33.2 pyparsing 3.2.3 pyqt5 5.15.11 pyqt5-qt5 5.15.2 pyqt5-sip 12.17.0 pysocks 1.7.1 python 3.9.23 python-dateutil 2.9.0.post0 python-levenshtein 0.27.1 pytorch 2.5.1 pytorch-cuda 12.4 pytorch-mutex 1.0 pywin32 310 pyyaml 6.0.2 qwen-vl-utils 0.0.8 rapidfuzz 3.13.0 regex 2024.11.6 requests 2.32.4 safetensors 0.5.3 scikit-image 0.24.0 scipy 1.13.1 segment-anything 1.0 setuptools 72.1.0 shapely 2.0.7 six 1.17.0 sleef 3.5.1 sniffio 1.3.1 sqlite 3.45.3 submitit 1.5.3 sympy 1.13.1 tabulate 0.9.0 tbb 2021.8.0 tensorboard 2.19.0 tensorboard-data-server 0.7.2 termcolor 3.1.0 tifffile 2024.8.30 timm 1.0.17 tk 8.6.14 tokenizers 0.21.2 tomli 2.2.1 torch 2.7.1 torchaudio 2.5.1 torchvision 0.22.1 tornado 4.5.3 tqdm 4.67.1 transformers 4.53.2 typing-extensions 4.14.1 typing-inspection 0.4.1 typing_extensions 4.12.2 tzdata 2025b ucrt 10.0.22621.0 urllib3 2.5.0 vc 14.3 vc14_runtime 14.44.35208 vs2015_runtime 14.44.35208 werkzeug 3.1.3 wheel 0.45.1 win_inet_pton 1.1.0 wrapt 1.17.0 xz 5.6.4 yacs 0.1.8 yaml 0.2.5 zipp 3.23.0 zlib 1.2.13 zstd 1.5.6
07-18
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Alexabc3000

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值