简体   繁体   English

构建 libjpeg-turbo as.dll

[英]Build libjpeg-turbo as .dll

I am looking for parametr for build libjpeg-turbo as.dll using MSYS2.我正在寻找使用 MSYS2 构建 libjpeg-turbo as.dll 的参数。

cmake -G"Unix Makefiles" -DENABLE_STATIC=ON -DENABLE_SHARED=ON ...

I have tried all combinations of STATIC=ON/OFF and SHARED=ON/OFF but I always got .a or .dll.a files.我尝试了 STATIC=ON/OFF 和 SHARED=ON/OFF 的所有组合,但我总是得到.a.dll.a文件。

The libjpeg-turbo library is already deployed as an msys2 package which contains both the source code and the binaries. libjpeg-turbo 库已部署为 msys2 package,其中包含源代码和二进制文件。
You can install libjpeg-turbo from the msys2 shell with the following command:您可以使用以下命令从 msys2 shell 安装 libjpeg-turbo:
$ pacman -S mingw-w64-x86_64-libjpeg-turbo
After installation you can copy the binary files you need (*.dll, *.dll.a) to the location you prefer to link them to your project.安装后,您可以将所需的二进制文件(*.dll、*.dll.a)复制到您希望将它们链接到项目的位置。

The CMake command you use is not appropriate on Windows.您使用的 CMake 命令不适用于 Windows。
You are asking CMake to generate a makefile for Unix, and as you know, Unix does not use DLLs.您要求 CMake 为 Unix 生成 makefile,并且如您所知,Z6EC1BD1EA6A5D67BBD1EA6A5D67A63B20C8ZF6Z 不使用。
You should (using the mingw64 shell) move to the build directory and use the following command:您应该(使用 mingw64 shell)移动到build目录并使用以下命令:
$ cmake -G"MinGW Makefiles" -DENABLE_STATIC=ON -DENABLE_SHARED=ON.. (not "Unix Makefiles") $ cmake -G"MinGW Makefiles" -DENABLE_STATIC=ON -DENABLE_SHARED=ON.. (不是"Unix Makefiles")
At this point (remaining in the build directory) you should type:此时(保留在build目录中)您应该键入:
mingw32-make
Now the compilation will begin and you will find the dll and all files you need.现在编译将开始,您将找到 dll 和您需要的所有文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM