我一直在尝试编译一个在VC++ 2010中使用zlib压缩的应用程序.
我明白了
error LNK2019: unresolved external symbol _inflateInit2_ referenced in function ...
Run Code Online (Sandbox Code Playgroud)
错误消息,如果我没有链接lib,这不会是不寻常的.我链接静态版本zlib库.
我已经设法让这些完全相同的libs和header配置在不同的解决方案中完美运行,因此这种行为非常出乎意料.
任何想法将不胜感激.
更新:链接器命令行
/OUT:"C:\Documents and Settings\Suthke\My Documents\Visual Studio 2010\Projects\SBRapGen2\Debug\SBRapGen2.exe" /INCREMENTAL /NOLOGO "zlib.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:"Debug\SBRapGen2.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Documents and Settings\Suthke\My Documents\Visual Studio 2010\Projects\SBRapGen2\Debug\SBRapGen2.pdb" /SUBSYSTEM:CONSOLE /PGD:"C:\Documents and Settings\Suthke\My Documents\Visual Studio 2010\Projects\SBRapGen2\Debug\SBRapGen2.pgd" /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE
更新2:详细链接器输出:
1>------ Build started: Project: SBRapGen2, Configuration: Release Win32 ------
1>
1> Starting pass 1
1> Processed /DEFAULTLIB:uuid.lib …Run Code Online (Sandbox Code Playgroud)