0 0 Votes

Lazarus: Program without GUI - Many WSRegister Errors

Question by Guest | 18/08/2014 at 14:54

At the moment, I am trying to code a program without GUI or Form (Command Line Tool) that should nevertheless be able to use some of the LCL functions.

For this, I have added "LCL" as requirement via menu "Project > Project Inspector > New Requirement" after I have created a "Simple Program" in Lazarus.

Unfortunately, when trying to compile my blank application, I encountered with the following errors:

project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomImageList
project1.lpr(11,1) Error: Undefined symbol: WSRegisterMenuItem
project1.lpr(11,1) Error: Undefined symbol: WSRegisterMenu
project1.lpr(11,1) Error: Undefined symbol: WSRegisterMainMenu
project1.lpr(11,1) Error: Undefined symbol: WSRegisterPopupMenu
project1.lpr(11,1) Error: Undefined symbol: WSRegisterDragImageList
project1.lpr(11,1) Error: Undefined symbol: WSRegisterLazAccessibleObject
project1.lpr(11,1) Error: Undefined symbol: WSRegisterControl
project1.lpr(11,1) Error: Undefined symbol: WSRegisterWinControl
project1.lpr(11,1) Error: Undefined symbol: WSRegisterGraphicControl
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomControl
project1.lpr(11,1) Error: Undefined symbol: WSRegisterScrollingWinControl
project1.lpr(11,1) Error: Undefined symbol: WSRegisterScrollBox
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomFrame
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomForm
project1.lpr(11,1) Error: Undefined symbol: WSRegisterHintWindow
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomScrollBar
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomGroupBox
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomComboBox
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomListBox
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomEdit
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomMemo
project1.lpr(11,1) Error: Undefined symbol: WSRegisterButtonControl
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomButton
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomCheckBox
project1.lpr(11,1) Error: Undefined symbol: WSRegisterToggleBox
project1.lpr(11,1) Error: Undefined symbol: WSRegisterRadioButton
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomStaticText
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomLabel
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomBitBtn
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomSpeedButton
project1.lpr(11,1) Error: Undefined symbol: WSRegisterShape
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomSplitter
project1.lpr(11,1) Error: Undefined symbol: WSRegisterPaintBox
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomImage
project1.lpr(11,1) Error: Undefined symbol: WSRegisterBevel
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomRadioGroup
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomCheckGroup
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomLabeledEdit
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomPanel
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCustomTrayIcon
project1.lpr(11,1) Error: Undefined symbol: WSRegisterCommonDialog
project1.lpr(11,1) Error: Undefined symbol: WSRegisterFileDialog
project1.lpr(11,1) Error: Undefined symbol: WSRegisterOpenDialog
project1.lpr(11,1) Error: Undefined symbol: WSRegisterSaveDialog
project1.lpr(11,1) Error: Undefined symbol: WSRegisterSelectDirectoryDialog
project1.lpr(11,1) Error: Undefined symbol: WSRegisterColorDialog
project1.lpr(11,1) Error: Undefined symbol: WSRegisterColorButton
project1.lpr(11,1) Error: Undefined symbol: WSRegisterFontDialog
project1.lpr(11,1) Fatal: There were 49 errors compiling module, stopping

How can I make my program running?

ReplyPositiveNegativeDateVotes

Delphian

Show Profile | Message
Avatar
3Best Answer
5 Votes

You have to add "Interfaces" to the USES section of your main program (the unit starting with "program"):

uses Interfaces;

Then it should work (with the LCL included so that the error messages will be solved).

Alternatively, I can recommend to remove the LCL requirement and to take the LCLBase instead. Usually, the LCLBase should contain all things you need for your command line application (file management, LCL Intf, LCL Proc etc) but not something like Forms and Dialogs that you do not need in most cases. With this, you can also radically remove the file size of your program when you do not have this "burden" in your app any more.
18/08/2014 at 15:15

ReplyPositive Negative
00 Votes

Thank you!

I had the same problem and applying what you suggested worked perfectly, I've started using Lazarus several times as an alternative to Delphi, let's see if this time I can get used to it.
05/03/2017 at 14:35

Positive Negative
00 Votes

Thank you!

Solved.
03/10/2017 at 05:19

Positive Negative
00 Votes

Thank you! Adding Interfaces did the job in the same situation.

This is the first clear answer on this question in Google.
01/11/2017 at 21:53

Positive Negative
00 Votes

Faced the same error, got on this forum, "Interfaces" added now after compilation I get an empty command line window, which quickly finishes its work.
03/02/2019 at 21:24

Positive Negative
Reply

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own articles on askingbox.com. How to do.