VC6调用高版本LIB常见错误

在VC6里调用更高版本的VS编译的LIB(2005/2008/2018等),经常会出现一些错误。

现在把常见错误整理一下,方便下次查询:


error LNK2001: unresolved external symbol ___CxxFrameHandler3
Q:  VS2005编译的静态库, 在vc++6.0中连接出现错误
error LNK2001: unresolved external symbol ___CxxFrameHandler3

A:  vs2005,  c/C++ Code generation ->enable c++ exceptions->NO
=========================================================================
error LNK2001: unresolved external symbol __imp___time64
Q: vs2005 generate a static lib(libva.lib), used in vc++6.0,
    error LNK2001: unresolved external symbol __imp___time64

T: time64 is a function in time.h .
 In vs2005 static lib, find a call .    info.time = time(NULL);
can not find  time64 symbol in libva.lib (use libDump tool)

A:
=========================================================================
error LNK2001: unresolved external symbol @__security_check_cookie
Q:VS2005编译的静态库, 在vc++6.0中连接出现错误

error LNK2001: unresolved external symbol @[email protected]

A:
VS2005 c/C++ Code generation ->buffer Security check NO(/GS-)
并且不能使用try{}
=========================================================================
error LNK2001:unresolved external symbol_ftol2
更改编译器设置,请使用"项目">"属性">"配置属性">" C / C ++">"代码生成">"启用增强指令集"。
在命令行上是/ arch:SSE或/ arch:SSE2。
还不行的话,继续往下看:
VC6编译时发现了这种错误,在网上查找是要调整工程中的SDKlib的顺序,可我根本没装SDK,调整什么呢。
其实我是在我的工程中引入了一个第三方lib,这个lib是用VC2003编译的,经过继续查找发现需要将这个库中所有带有__ftol2的地方用16进制编辑器打开,将其中的5F5F66746F6C32替换成5F5F66746F6C00就可以了,实际上是将__ftol2替换成了__ftol

你可能感兴趣的:(C++/VC/MFC)