Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2021-09

Lazarus 2.0.12 on Windows x64 cannot build command line program, complains about missing GUI symbols

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I have created a very simple program which is supposed to send a backup zipfile to a webserver by FTP. I am used to Indy so I use TIdFTP as the object for this transfer.
I started in lazarus by creating a new program which gave me a very sparse skeleton only adding Classes as used unit.
I added indylaz to the project dependencies and the uses clause as shown below.

So now I wrote my code and checked it using Run/QuickCompile and it succeeds. So I tried Run/Compile and get 50 errors, same with Run/Build...

And the error messages are completely wild, here are a few of them:

Compile Project, Target: FtpXferDb.exe: Exit code 1, Errors: 50 Error: Undefined symbol: WSRegisterCustomPage
Error: Undefined symbol: WSRegisterCustomNotebook
Error: Undefined symbol: WSRegisterCustomImageListResolution Error: Undefined symbol: WSRegisterMenuItem
Error: Undefined symbol: WSRegisterMenu
Error: Undefined symbol: WSRegisterMainMenu
Error: Undefined symbol: WSRegisterPopupMenu
Error: Undefined symbol: WSRegisterDragImageListResolution Error: Undefined symbol: WSRegisterLazAccessibleObject Error: Undefined symbol: WSRegisterControl
Error: Undefined symbol: WSRegisterWinControl
....
Error: Undefined symbol: WSRegisterStatusBar
Error: Undefined symbol: WSRegisterTabSheet
Error: Undefined symbol: WSRegisterPageControl
Error: Undefined symbol: WSRegisterCustomListView
Error: Undefined symbol: WSRegisterCustomProgressBar Error: Undefined symbol: WSRegisterCustomUpDown
Error: Undefined symbol: WSRegisterCustomToolButton

Everything seems to be about GUI stuff which I do not use at all! This is a command line program....

What can I do to remedy this?

This is my uses clause:

uses

  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes,
  indylaz,
  { you can add units after this }
  SysUtils,
  IniFiles,
  IdFTP,
  IdFTPCommon;
Bo Berglund Developer in Sweden

Reply by email

R.Smith
to Bo Berglund

Either remove any Indy units added automatically to your main program's uses clause (namely IdFTP,IdFTPCommon - it's not needed there, maybe IniFiles too), or simply add the "Interfaces" unit to your uses clause (preferably at the start).

Bo Berglund wrote 53 lines
I have created a very simple program which is supposed to send a backup zipfile to a webserver by FTP. I am used to Indy so I use TIdFTP as the object for this transfer. I started in lazarus by creating a new program which gave me a very sparse skeleton only adding Classes as used unit. I added indylaz to the project dependencies and the uses clause as shown below. So now I wrote my code and checked it using Run/QuickCompile and it succeeds. So I tried Run/Compile and get 50 errors, same with Run/Build... And the error messages are completely wild, here are a few of them: Compile Project, Target: FtpXferDb.exe: Exit code 1, Errors: 50 Error: Undefined symbol: WSRegisterCustomPage Error: Undefined symbol: WSRegisterCustomNotebook Error: Undefined symbol: WSRegisterCustomImageListResolution Error: Undefined symbol: WSRegisterMenuItem Error: Undefined symbol: WSRegisterMenu Error: Undefined symbol: WSRegisterMainMenu Error: Undefined symbol: WSRegisterPopupMenu Error: Undefined symbol: WSRegisterDragImageListResolution Error: Undefined symbol: WSRegisterLazAccessibleObject Error: Undefined symbol: WSRegisterControl Error: Undefined symbol: WSRegisterWinControl .... Error: Undefined symbol: WSRegisterStatusBar Error: Undefined symbol: WSRegisterTabSheet Error: Undefined symbol: WSRegisterPageControl Error: Undefined symbol: WSRegisterCustomListView Error: Undefined symbol: WSRegisterCustomProgressBar Error: Undefined symbol: WSRegisterCustomUpDown Error: Undefined symbol: WSRegisterCustomToolButton Everything seems to be about GUI stuff which I do not use at all! This is a command line program.... What can I do to remedy this? This is my uses clause: uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes, indylaz, { you can add units after this } SysUtils, IniFiles, IdFTP, IdFTPCommon;

Reply by email

Bo Berglund
to R.Smith
"R.Smith wrote 5 lines
Either remove any Indy units added automatically to your main program's uses clause (namely IdFTP,IdFTPCommon - it's not needed there, maybe IniFiles too), or simply add the "Interfaces" unit to your uses clause (preferably at the start).

Turns out that Lazaus adds indylaz to the uses clause when I specify that the indylaz package sould be "required" by te program. When I removed it from uses (while keeping the package as requierd) the error went away.

Bo Berglund Developer in Sweden

Reply by email