TDateTime LinkError

时间:2012-09-12 08:10:16

标签: c++ linker linker-errors

我正在使用C ++ Builder并收到以下错误:

[ILINK32 Error] Error: Unresolved external '__fastcall System::Internal::Strhlpr::UnicodeFree(System::UnicodeString&)' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\RAD STUDIO\9.0\LIB\WIN32\DEBUG\VCLE.LIB|ustring
[ILINK32 Error] Error: Unresolved external '__fastcall System::Internal::Strhlpr::UnicodeFromPChar(System::UnicodeString&, char *, bool)' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\RAD STUDIO\9.0\LIB\WIN32\DEBUG\VCLE.LIB|ustring
[ILINK32 Error] Error: Unresolved external '__fastcall System::Sysutils::StrToDateTime(const System::UnicodeString)' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\RAD STUDIO\9.0\LIB\WIN32\DEBUG\VCLE.LIB|datetime
[ILINK32 Error] Error: Unresolved external '__fastcall System::Sysutils::StrToDate(const System::UnicodeString)' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\RAD STUDIO\9.0\LIB\WIN32\DEBUG\VCLE.LIB|datetime
[ILINK32 Error] Error: Unresolved external '__fastcall System::Syncobjs::TInterlocked::Increment(int&)' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\RAD STUDIO\9.0\LIB\WIN32\DEBUG\VCLE.LIB|ustring
[ILINK32 Error] Error: Unresolved external '__fastcall System::Sysutils::StrToTime(const System::UnicodeString)' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\RAD STUDIO\9.0\LIB\WIN32\DEBUG\VCLE.LIB|datetime
[ILINK32 Error] Error: Unable to perform link

这是我在main中的代码:

int _tmain(int argc, _TCHAR* argv[])
{

//TDateTime Mine("12/05/1990",TDateTime::TDateTimeFlag::Date);

TDateTime Mine("12/05/1990");

getch();
return 0;
}

我已经加入了'vcl.h'

我能做些什么才能让它发挥作用?

1 个答案:

答案 0 :(得分:1)

我现在不使用Borland / Embarcadero工具,但我猜你忘了链接到vcle.lib,因为链接器报告。

似乎TDateTime构造函数使用Sysutils::StrToDateTime(),它是在vcle.lib中实现的。

将vcle.lib添加到链接器设置,并查看它是否构建。可以在Project Options > Linker

中修改链接器设置