[英]What files to include for linking libjpeg-turbo in Visual Studio C++ 2017
I installed the library with vcpkg: https://github.com/Microsoft/vcpkg我用 vcpkg 安装了库: https://github.com/Microsoft/vcpkg
In the PowerShell (Admin):在 PowerShell(管理员)中:
.\vcpkg install libjpeg-turbo:x64-windows-static
.\vcpkg integrate install
I added reference to the library in:我在以下位置添加了对库的引用:
Configuration Properties > C/C++ > General > Additional Include Directories: [path]libjpeg-turbo-gcc\include配置属性 > C/C++ > 常规 > 附加包含目录: [path]libjpeg-turbo-gcc\include
Configuration Properties > Linker > General > Additional Library Directories: [path]libjpeg-turbo-gcc\lib配置属性 > Linker > 常规 > 附加库目录: [路径]libjpeg-turbo-gcc\lib
Configuration Properties > Linker > Input > Additional Dependencies :配置属性 > Linker > 输入 > 附加依赖项:
But I obtain the linking errors:但我得到了链接错误:
LNK2019: unresolved external symbol _sscanf referenced in function _jinit_memory_mgr libjpeg.a(jmemmgr.c.obj) LNK2019:在 function _jinit_memory_mgr libjpeg.a(jmemmgr.c.obj) 中引用的未解析外部符号 _sscanf
LNK2019: unresolved external symbol _sprintf referenced in function _format_message libjpeg.a(jerror.c.obj) LNK2019:在 function _format_message libjpeg.a(jerror.c.obj) 中引用的未解析外部符号 _sprintf
I tried to add the libturbojpeg.dll and libjpeg-62.dll from the libjpeg-turbo-gcc\bin folder but I obtain a link error LNK1107 invalid or corrupt file: cannot read at 0x3D0 \libjpeg-turbo-gcc\bin\libturbojpeg.dll.我尝试从 libjpeg-turbo-gcc\bin 文件夹中添加 libturbojpeg.dll 和 libjpeg-62.dll 但我收到一个链接错误 LNK1107 invalid or corrupt file: cannot read at 0x3D0\libjpeg-gcc .dll。
Which files do I have to include and where to find them?我必须包含哪些文件以及在哪里可以找到它们? Thank you in advance.先感谢您。
Please find what did work for me at the end.请找出最后对我有用的东西。 Using vcpkg:使用 vcpkg:
.\vcpkg install libjpeg-turbo:x64-windows
.\vcpkg integrate install
In Visual Studio don't reference any libraries or it will lead to linker errors, only add the include to vcpkg installed libraries:在 Visual Studio 中不要引用任何库,否则会导致 linker 错误,只需将 include 添加到 vcpkg 安装的库中:
Configuration Properties > C/C++ > General > Additional Include Directories :配置属性 > C/C++ > 常规 > 附加包含目录:
[vcpkg path] \vcpkg\installed\x64-windows\include
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.