编译时_RTC_Shutdown和_RTC_InitBase相关错误的解决方法

RTC*这些符号是Visual C++编译器(据说是9以上的版本,对应visual studio 2008以上版本)的Runtime Check 功能的入口。

在编译库文件时,如果选择了运行时检查,那么别的应用程序在链接这个库文件进行编译的时候,就有可能报如下错误:

try.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

try.obj : error LNK2001: unresolved external symbol _RTC_InitBase

main.obj : error LNK2001: 无法解析的外部符号 _RTC_Shutdown
main.obj : error LNK2001: 无法解析的外部符号 _RTC_InitBase

D:/download/LAMP/rrdtool-1.4.5/win32/Debug//rrdlib.lib(Debug/rrd_version.obj):(.rtc$TMZ+0x0): undefined reference to `_RTC_Shutdown'
D:/download/LAMP/rrdtool-1.4.5/win32/Debug//rrdlib.lib(Debug/rrd_version.obj):(.rtc$IMZ+0x0): undefined reference to `_RTC_InitBase'
collect2: ld returned 1 exit status

解决方法就是修改“基本运行时检查”,然后重新编译库文件。

修改方法:

    右键点击项目,修改:属性 > 配置属性 > C/C++ > 代码生成 > 基本运行时检查,将值从“两者(......)”改为“默认值”。

猜你喜欢

转载自blog.csdn.net/huzhenwei/article/details/6394824
RTC