gpt4 book ai didi

c - libpng.lib 中的链接器错误 "unresolved external symbol __imp___iob_func"

转载 作者:行者123 更新时间:2023-12-04 10:26:59 25 4
gpt4 key购买 nike

我正在尝试为 Windows Mobile 6 编译 libpng,但我不断收到以下链接器错误:

error LNK2019: unresolved external symbol __imp___iob_func referenced in function png_default_error libpng.lib
error LNK2019: unresolved external symbol __imp_abort referenced in function png_longjmp

编译是使用/MD 选项完成的,在我的主项目中也是如此。 zlib 和 libpng。

改用/MT时,还是有错误,只是略有不同:

error LNK2019: unresolved external symbol __iob_func referenced in function png_default_error
error LNK2019: unresolved external symbol abort referenced in function png_longjmp

这带来了几个问题。

  1. 什么是 __imp___iob_func__imp_abort
  2. 它们在哪里实现?或者,如何排除对它们的引用?

我的 libpng 编译器选项:

/Od /I "..\lib\zlib-1.2.7" /I "..\lib\lpng1512" /D "_DEBUG" /D "_WIN32_WCE=0x502" /D "UNDER_CE" /D "WIN32_PLATFORM_PSPC" /D "WINCE" /D "DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LIBPNG_EXPORTS" /D "ARM" /D "_ARM_" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /MDd /fp:fast /GR- /Fo"Windows Mobile 6 Professional SDK (ARMV4I)\Debug/" /Fd"Windows Mobile 6 Professional SDK (ARMV4I)\Debug/vc80.pdb" /W3 /nologo /c /Zi /TC /QMFPE-

图书管理员选项:

/OUT:"Windows Mobile 6 Professional SDK (ARMV4I)\Debug\libpng.lib" /LIBPATH:"C:\Program Files\Windows Mobile 6 SDK\PocketPC\Lib\Armv4i" /NOLOGO /NODEFAULTLIB Coredll.lib /SUBSYSTEM:WINDOWSCE,5.02

我的项目(libpngStreamWrap)编译选项:

/Od /I "..\lib\lpng1512" /D "_DEBUG" /D "_WIN32_WCE=0x502" /D "UNDER_CE" /D "WIN32_PLATFORM_PSPC" /D "WINCE" /D "DEBUG" /D "_LIB" /D "ARM" /D "_ARM_" /D "_UNICODE" /D "UNICODE" /D "_WINDLL" /Gm /EHsc /MDd /fp:fast /GR- /Yu"stdafx.h" /Fp"Windows Mobile 6 Professional SDK (ARMV4I)\Debug/libpngStreamWrap.pch" /Fo"Windows Mobile 6 Professional SDK (ARMV4I)\Debug/" /Fd"Windows Mobile 6 Professional SDK (ARMV4I)\Debug/vc80.pdb" /W3 /nologo /c /Zi /TP

链接器选项:

/OUT:"Windows Mobile 6 Professional SDK (ARMV4I)\Debug\libpngStreamWrap.dll" /NOLOGO /DLL /MANIFEST:NO /NODEFAULTLIB:"oldnames.lib" /DYNAMICBASE /NXCOMPAT /ERRORREPORT:PROMPT coredll.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib "..\libpng\windows mobile 6 professional sdk (armv4i)\debug\libpng.lib" "..\zlib\windows mobile 6 professional sdk (armv4i)\debug\zlib.lib"  /SUBSYSTEM:WINDOWSCE,5.02 /VERBOSE:lib

最佳答案

最近在 png-mng-implement 列表上讨论过这个在 sourceforge.net(主题 libpng Visual Studio 2010 项目):

After several long googling sessions it turned out that the reason was that libpng debug profile "Runtime library" setting is not set to "Multi-threaded Debug DLL" as excepted, but instead to "Multi-threaded DLL", which is the same profile as used in the release build.

这是一个错误。这似乎是对vcxproj 项目文件 - 如果删除了 RuntimeLibrary 元素或无效,它被设置为默认值,即 DLL 的/MD。

它可以在 libpng 1.5 中修复,但这将是一个 API 更改并且会破坏现有的、正在运行的 libpng 1.5 项目。因此我认为最好的办法是添加警告通知(可能在单独的文件 WARNING) 到 projects/vstudio 指出问题。人们很容易更改设置,一旦他们知道它是可能是错误的。

关于c - libpng.lib 中的链接器错误 "unresolved external symbol __imp___iob_func",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12933309/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com