Delphi – Linux windres cross-compile and error

Lately I came across very annoying problem with installed Free Pascal  IDE  (CodeTyphon or Lazarus) under Linux Mint 18.1. When you try to compile the project the following error pops up:

 Error: resource compiler "windres.exe" not found, switching to external mode

For compatibility reasons the fpc toolchain uses windres to compile and link the resource files to your project. It uses Delphi compatible RC format. When you are cross-compiling for Windows you need to install mingw to be able to use windres.

You can do it with the following command under debian:

sudo apt-get install mingw-w64

Then create a symlink to allow the IDE find the executable:

sudo ln -s /usr/bin/x86_64-w64-mingw32-windres /usr/bin/windres

This should fix the problem with compiling RC files.

If you get Linker warnings "crtbegin.o" not found" when compiling your project, you have to ensure that latest GNU libraries are added to the fpc.cnf file which is used during linking and compilation of your projects.

In order to fix this warning add this line:

to your fpc.cnf file, #searchpath for libraries section, which looks like this:

# searchpath for libraries


version*  is the latest GNU compiler version installed to your system.

Tell us about your thoughtsWrite message

Your email address will not be published. Required fields are marked *