在C ++中使用TList时无法解决的外部错误

时间:2018-08-21 14:29:29

标签: clang linker-errors c++builder 32-bit

使用bcc32c(Embarcadero)编译项目时,出现以下链接器错误:

似乎他没有找到库 VCL

[ilink32 Error] Error: Unresolved external 'System::__linkproc__ 
__fastcall LStrAsg(System::AnsiStringT&, System::AnsiStringT) 
 referenced from ...DEBUG\VCLE.LIB|System_t_win32

[ilink32 Error] Error: Unresolved external System::__linkproc__ 
__fastcall LStrCat(System::AnsiStringT&, System::AnsiStringT) 

[ilink32 Error] Error: Unresolved external System::__linkproc__ 
__fastcall LStrCat3(System::AnsiStringT&, System::AnsiStringT)

[ilink32 Error] Error: Unresolved external System::__linkproc__ 
__fastcall LStrClr(void *) referenced from ...

[ilink32 Error] Error: Unresolved external System::__linkproc__ 
__fastcall LStrCmp()

[ilink32 Error] Error: Unresolved external System::__linkproc__ 
__fastcall LStrDelete(System::AnsiStringT&, int, int) referenced 
from ...

[ilink32 Error] Error: Unresolved external System::__linkproc__ 
__fastcall LStrFromArray(System::AnsiStringT&, char *, int, 
unsigned short) referenced from 

[ilink32 Error] Error: Unresolved external System::__linkproc__ 
__fastcall LStrFromPChar(System::AnsiStringT&, char *, unsigned 
short) referenced from...

[ilink32 Error] Error: Unresolved external System::__linkproc__ 
__fastcall StrFromUStr(System::AnsiStringT&,System::UnicodeString, 
unsigned short) referenced from...

1 个答案:

答案 0 :(得分:2)

问题是链接器无法解析VCL类引用。

在项目中插入VCL C ++表单。

右键单击该项目,然后添加New-> VCL Form C ++ Builder

不必保存unit.h / .cpp。 您可以依次从项目中删除表单。这仅是要创建链接所必需的

right click on the project

Embarcadero在您的.cbproj文件中输入了代码FrameworkType = VCL。

<PropertyGroup>
    <ProjectGuid>{xxxx}/ProjectGuid>
    <ProjectVersion>XX.Y</ProjectVersion>
    <FrameworkType>VCL</FrameworkType>

必须解决问题。