项目无法编译,因为代码块已删除。

huangapple go评论86阅读模式
英文:

Project not compiling due to deleted blocks of code

问题

I am following the RAD Studio tutorial in the official Embarcadero documentation, but now it won't compile. It outputs this error message:

[ilink32 Error] Error: Unresolved external '__fastcall TTextEditorForm::FormGesture(System::TObject *, Fmx::Types::TGestureEventInfo&, bool&)' referenced from C:\USERS\ADMIN\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\WIN32\DEBUG\DOCSTUT.OBJ
[ilink32 Error] Error: Unresolved external '__fastcall TTextEditorForm::NewClick(System::TObject *)&' referenced from C:\USERS\ADMIN\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\WIN32\DEBUG\DOCSTUT.OBJ
[ilink32 Error] Error: Unable to perform link

I believe that what happened was that I mis-clicked one of the items and added an event handler for OnFormGesture, which I didn't mean to and immediately deleted.

Additionally, when I was going back and forth between the design view and the code editor, I got this error message:

[6F9B92B1]{rtl280.bpl  } System.Classes.TInterfaceList.Clear (Line 5607, "System.Classes.pas" + 1) + $3
[6F8C39CC]{rtl280.bpl  } System.@UStrSetLength (Line 31269, "System.pas" + 27) + $0
[6F8C3B80]{rtl280.bpl  } System.@UStrCatN (Line 31641, "System.pas" + 67) + $0
[69FA10FB]{comptoolbar280.bpl} CompToolbarFrame.TComponentToolbarFrame.InitializePalette (Line 840, "CompToolbarFrame.pas" + 1) + $9
[69FA0A43]{comptoolbar280.bpl} CompToolbarFrame.TComponentToolbarFrame.EndUpdate (Line 659, "CompToolbarFrame.pas" + 13) + $6
[6EDC4293]{coreide280.bpl} PalMgr.TPaletteManager.EndUpdate (Line 1111, "PalMgr.pas" + 13) + $5
[6F01FE6B]{coreide280.bpl} EditorForm.TEditWindow.EndViewSelect (Line 4820, "EditorForm.pas" + 1) + $9
[6F018DD7]{coreide280.bpl} EditorForm.TEditWindow.SwitchViews (Line 2296, "EditorForm.pas" + 11) + $3
[6F0188D2]{coreide280.bpl} EditorForm.TEditWindow.ViewBarChange (Line 2136, "EditorForm.pas" + 10) + $10
[6E3A8701]{vcl280.bpl  } Vcl.Tabs.TTabSet.CanChange (Line 1962, "Vcl.Tabs.pas" + 3) + $D
[6E3A8751]{vcl280.bpl  } Vcl.Tabs.TTabSet.SetTabIndex (Line 1973, "Vcl.Tabs.pas" + 5) + $4
[6E3A89D6]{vcl280.bpl  } Vcl.Tabs.TTabSet.MouseDown (Line 2085, "Vcl.Tabs.pas" + 6) + $6
[6E1D8670]{vcl280.bpl  } Vcl.Controls.TControl.DoMouseDown (Line 7730, "Vcl.Controls.pas" + 7) + $29
[6E1D6A1B]{vcl280.bpl  } Vcl.Controls.TControl.SetMouseCapture (Line 6654, "Vcl.Controls.pas" + 2) + $6
[6E1D86BF]{vcl280.bpl  } Vcl.Controls.TControl.WMLButtonDown (Line 7741, "Vcl.Controls.pas" + 7) + $E
[6E1D802E]{vcl280.bpl  } Vcl.Controls.TControl.WndProc (Line 7591, "Vcl.Controls.pas" + 91) + $6
[6E2E3338]{vcl280.bpl  } Vcl.Themes.TStyleManager.HandleMessage (Line 5872, "Vcl.Themes.pas" + 11) + $11
[6E1DD1F5]{vcl280.bpl  } Vcl.Controls.TWinControl.WndProc (Line 10644, "Vcl.Controls.pas" + 170) + $6

I tried doing clean builds, but that didn't change anything. I tried using the RAD Studio Command Line, but it always said the project didn't exist. I also tried right-clicking the error messages and to View Source, but the option was grayed out.

英文:

I am following the RAD Studio tutorial in the official Embarcadero documentation, but now it won't compile. It outputs this error message:

[ilink32 Error] Error: Unresolved external '__fastcall TTextEditorForm::FormGesture(System::TObject *, Fmx::Types::TGestureEventInfo&, bool&)' referenced from C:\USERS\ADMIN\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\WIN32\DEBUG\DOCSTUT.OBJ
[ilink32 Error] Error: Unresolved external '__fastcall TTextEditorForm::NewClick(System::TObject *)' referenced from C:\USERS\ADMIN\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\WIN32\DEBUG\DOCSTUT.OBJ
[ilink32 Error] Error: Unable to perform link

I believe that what happened was that I mis-clicked one of the items and added an event handler for OnFormGesture, which I didn't mean to and immediately deleted.

Additionally, when I was going back and forth between the design view and the code editor, I got this error message:

[6F9B92B1]{rtl280.bpl  } System.Classes.TInterfaceList.Clear (Line 5607, "System.Classes.pas" + 1) + $3
[6F8C39CC]{rtl280.bpl  } System.@UStrSetLength (Line 31269, "System.pas" + 27) + $0
[6F8C3B80]{rtl280.bpl  } System.@UStrCatN (Line 31641, "System.pas" + 67) + $0
[69FA10FB]{comptoolbar280.bpl} CompToolbarFrame.TComponentToolbarFrame.InitializePalette (Line 840, "CompToolbarFrame.pas" + 1) + $9
[69FA0A43]{comptoolbar280.bpl} CompToolbarFrame.TComponentToolbarFrame.EndUpdate (Line 659, "CompToolbarFrame.pas" + 13) + $6
[6EDC4293]{coreide280.bpl} PalMgr.TPaletteManager.EndUpdate (Line 1111, "PalMgr.pas" + 13) + $5
[6F01FE6B]{coreide280.bpl} EditorForm.TEditWindow.EndViewSelect (Line 4820, "EditorForm.pas" + 1) + $9
[6F018DD7]{coreide280.bpl} EditorForm.TEditWindow.SwitchViews (Line 2296, "EditorForm.pas" + 11) + $3
[6F0188D2]{coreide280.bpl} EditorForm.TEditWindow.ViewBarChange (Line 2136, "EditorForm.pas" + 10) + $10
[6E3A8701]{vcl280.bpl  } Vcl.Tabs.TTabSet.CanChange (Line 1962, "Vcl.Tabs.pas" + 3) + $D
[6E3A8751]{vcl280.bpl  } Vcl.Tabs.TTabSet.SetTabIndex (Line 1973, "Vcl.Tabs.pas" + 5) + $4
[6E3A89D6]{vcl280.bpl  } Vcl.Tabs.TTabSet.MouseDown (Line 2085, "Vcl.Tabs.pas" + 6) + $6
[6E1D8670]{vcl280.bpl  } Vcl.Controls.TControl.DoMouseDown (Line 7730, "Vcl.Controls.pas" + 7) + $29
[6E1D6A1B]{vcl280.bpl  } Vcl.Controls.TControl.SetMouseCapture (Line 6654, "Vcl.Controls.pas" + 2) + $6
[6E1D86BF]{vcl280.bpl  } Vcl.Controls.TControl.WMLButtonDown (Line 7741, "Vcl.Controls.pas" + 7) + $E
[6E1D802E]{vcl280.bpl  } Vcl.Controls.TControl.WndProc (Line 7591, "Vcl.Controls.pas" + 91) + $6
[6E2E3338]{vcl280.bpl  } Vcl.Themes.TStyleManager.HandleMessage (Line 5872, "Vcl.Themes.pas" + 11) + $11
[6E1DD1F5]{vcl280.bpl  } Vcl.Controls.TWinControl.WndProc (Line 10644, "Vcl.Controls.pas" + 170) + $6

I tried doing clean builds, but that didn't change anything. I tried using the RAD Studio Command Line, but it always said the project didn't exist. I also tried right-clicking the error messages and to View Source, but the option was grayed out.

答案1

得分: 1

我相信发生的事情是我误点击了其中一个项目,为OnFormGesture添加了一个事件处理程序,我并不打算这样做,然后立刻删除了它。

听起来你从Form的.cpp文件中删除了整个方法定义,但没有从Form的.h文件中删除相应的声明。更新.h文件,错误应该会消失。

处理设计时事件处理程序时,最好让IDE来管理它们。如果你想删除一个未使用的事件处理程序,不要手动删除它。只需删除处理程序定义体内的所有代码。当文件保存时,IDE会自动删除分配给已发布事件的事件处理程序。

此外,当我在设计视图和代码编辑器之间来回切换时,我收到了这个错误消息

这明显是IDE本身的一个错误。这样的错误应该直接报告给 Embarcadero

英文:

> I believe that what happened was that I mis-clicked one of the items and added an event handler for OnFormGesture, which I didn't mean to and immediately deleted.

It sounds like you deleted the entire method definition from the Form's .cpp file, but did not delete the corresponding declaration from the Form's .h file. Update the .h file and the error should go away.

When dealing with event handlers at design-time, it is better to let the IDE manage them for you. If you want to remove an unused event handler, don't actually delete it manually. Just remove all of the code inside of the body of the handler's definition. When the file is saved, the IDE automatically deletes empty event handlers that are assigned to published events.

> Additionally, when I was going back and forth between the design view and the code editor, I got this error message

That is clearly a bug in the IDE itself. Such errors should be reported to Embarcadero directly.

huangapple
  • 本文由 发表于 2023年6月8日 23:05:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/76433242.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定