连接错误"解析外部符号__imp ___ iob_func"在libpng.lib [英] Linker error "unresolved external symbol __imp___iob_func" in libpng.lib

查看:3278
本文介绍了连接错误"解析外部符号__imp ___ iob_func"在libpng.lib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译的libpng为Windows Mobile 6,但我白马得到以下链接器错误:

 错误LNK2019:​​解析外部符号__imp___iob_func在功能上png_default_error libpng.lib引用
错误LNK2019:​​无法解析的外部符号功能png_longjmp __imp_abort引用

编译使用/ MD选项,我的主要项目之间同样进行。 zlib的和libpng。

当/ MT被代替,仍有误差,但稍有不同:

 错误LNK2019:​​解析外部符号__iob_func函数png_default_error引用
错误LNK2019:​​解析外部符号中止进行中的功能png_longjmp引用

这带来了一些问题。


  1. 什么是 __ ___小鬼iob_func __ imp_abort

  2. 在哪里,他们在实施?另外,如何给他们一个参考排除?

我的libpng编译器选项:

  / OD / I.. \\ lib目录\\的zlib-1.2.7/ I.. \\ lib目录\\ lpng1512/ D_DEBUG/ D_WIN32_WCE = 0x502 / DUNDER_CE/ DWIN32_PLATFORM_PSPC/ DWINCE/ DDEBUG/ D_WINDOWS/ D_USRDLL/ DLIBPNG_EXPORTS/ DARM/ D_ARM_/ D_UNI code/ DUNI code/ GM / EHSC / MDD / FP:快/ GR-/ FO的Windows Mobile 6专业版SDK(ARMV4I)\\调试// FD的Windows Mobile 6专业版SDK( ARMV4I)\\调试/ vc80.pdb/ W3 / NOLOGO / C /紫/ TC / QMFPE-

库管理程序选项:

  / OUT:Windows Mobile 6专业SDK(ARMV4I)\\调试\\ libpng.lib/ LIBPATH:C:\\ Program Files文件\\的Windows Mobile 6 SDK \\无忧\\ LIB \\ ARMV4I/ NOLOGO / NODEFAULTLIB Coredll.lib /SUBSYSTEM:WINDOWSCE,5.02

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

  / OD / I.. \\ lib目录\\ lpng1512/ D_DEBUG/ D_WIN32_WCE = 0x502/ DUNDER_CE/ DWIN32_PLATFORM_PSPC/ DWINCE / DDEBUG/ D_LIB/ DARM/ D_ARM_/ D_UNI code/ DUNI code/ D_WINDLL/ GM / EHSC / MDD / FP:快/ GR-/Yu\"stdafx.h/ FP的Windows Mobile 6专业版SDK(ARMV4I)\\调试/ libpngStreamWrap.pch/ FO的Windows Mobile 6专业版SDK(ARMV4I)\\调试// FD Windows Mobile 6专业SDK(ARMV4I)\\调试/ vc80.pdb/ W3 / NOLOGO / C /紫/ TP

链接器选项:

  / OUT:Windows Mobile 6专业SDK(ARMV4I)\\调试\\ 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专业SDK(ARMV4I)\\调试\\ libpng.lib.. \\ ZLIB \\ Windows Mobile 6专业SDK(ARMV4I)\\调试\\ zlib.lib/SUBSYSTEM:WINDOWSCE,5.02 / VERBOSE:LIB


解决方案

这是最近的讨论PNG,MNG,实施名单
在sourceforge.net(话题了libpng的Visual Studio 2010项目):


  

几个长谷歌搜索会后,它原来,原因是
  该调试的libpng资料运行库设置未设置为
  多线程​​调试DLL作为例外,而是要多线程
  DLL,这是因为在发布版本中使用的相同的配置文件


这是一个错误。这似乎是一个糟糕的手编辑的结果
vcxproj项目文件 - 如果RuntimeLibrary元素被删除或
无效它被设置为默认的,这是一个DLL / MD。

它可以被固定在了libpng 1.5,但是这将是一个API变化和
将打破现有的工作,libpng的1.5项目。因此我
认为最好的办法是在添加警告通知(可能
单独的文件警告)为项目/ vstudio指出的问题。
这很容易让人们改变设置,一旦他们知道这是
可能是错误的。

I am trying to compile libpng for Windows Mobile 6, but i kep getting the following linker errors:

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

Compilation is done with /MD option, same between my main project. zlib and libpng.

When /MT is used instead, there are still errors, but slightly different:

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

That brings several questions.

  1. What are __imp___iob_func and __imp_abort?
  2. Where are they implemented at? Alternatively, how can a reference to them be excluded?

My libpng compiler options:

/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-

librarian options:

/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

My project (libpngStreamWrap) compiler options:

/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

linker options:

/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

解决方案

This has been discussed recently on the png-mng-implement list at sourceforge.net (topic libpng Visual Studio 2010 project):

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.

This is a bug. It seems to be a result of a bad hand edit to the vcxproj project files - if the RuntimeLibrary element is removed or invalid it gets set to the default, which is /MD for a DLL.

It could be fixed in libpng 1.5, but that would be an API change and would break existing, working, libpng 1.5 projects. Consequently I think the best thing is to add a warning notice (probably in a separate file WARNING) to projects/vstudio pointing out the problem. It's easy for people to change the setting once they know it is potentially wrong.

这篇关于连接错误"解析外部符号__imp ___ iob_func"在libpng.lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆