0

我正在使用 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

这是我的主要代码:

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

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

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

getch();
return 0;
}

我已经包括了'vcl.h'

我该怎么做才能让它工作?

4

1 回答 1

1

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

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

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

于 2012-09-12T08:17:54.630 回答