22 Votes

Lazarus: Program without GUI - Many WSRegister Errors

Question by Guest | Last update on 2022-04-01 | Created on 2014-08-18

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
8Best Answer10 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 disappear).

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, LCLIntf, LCLProc etc) but nothing 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.
Last update on 2022-04-01 | Created on 2014-08-18

ReplyPositive Negative
22 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.
2017-03-05 at 14:35

Positive Negative
00 Votes

Thank you!

Solved.
2017-10-03 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.
2017-11-01 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.
2019-02-03 at 21:24

Positive Negative
00 Votes

Thank you!

You helped me a lot with this answer!!

It was great!
2022-03-21 at 20:00

Positive Negative
Reply
Reply

Related Topics

Program in ZIP-Folder

Info | 0 Comments

Delphi: System-Wide HotKey

Tutorial | 1 Comment

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 article on askingbox.com. That’s how it’s done.