* * *

Author Topic: Error: resource compiler "windres.exe" not found, switching to external mode  (Read 5804 times)

apostleofchrist

  • New member
  • *
  • Posts: 21
Greetings fellow developers!

I have hit a wall here. I uninstalled my previous version of Lazarus in order to use the new 1.6.
I downloaded and installed, as I always have and when I tried to compile my project, I've got this message:

Code: Pascal  [Select]
  1. epassdist.lpr(34,1) Error: resource compiler "windres.exe" not found, switching to external mode
  2.  

I've searched inside Lazarus instalation folder for that file and it isn't anywhere.

Here it is my .lpr file code:

Code: Pascal  [Select]
  1. program epassdist;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   {$IFDEF UNIX}{$IFDEF UseCThreads}
  7.   cthreads,
  8.   {$ENDIF}{$ENDIF}
  9.   Interfaces, // this includes the LCL widgetset
  10.   Forms, udistprincipal, LResources, zcomponent, datamod1, printer4lazarus,
  11.   memdslaz;
  12.  
  13. {$IFDEF WINDOWS}{$R epassdist.rc}{$ENDIF}
  14.  
  15. const
  16.   //IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = $8000;
  17.   // Following are already defined in D7's Windows.pas
  18.   IMAGE_FILE_RELOCS_STRIPPED               = $0001;
  19.   IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP       = $0400;
  20.   IMAGE_FILE_NET_RUN_FROM_SWAP             = $0800;
  21.  
  22. //{$R *.res}
  23. //{$SetPEOptFlags IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE}
  24. {$SetPEFlags IMAGE_FILE_RELOCS_STRIPPED
  25.   or IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP
  26.   or IMAGE_FILE_NET_RUN_FROM_SWAP}
  27.  
  28. begin
  29.   {$I epassdist.lrs}
  30.   Application.Initialize;
  31.   Application.CreateForm(TFrmDistPrincipal, FrmDistPrincipal);
  32.   Application.CreateForm(TDM1, DM1);
  33.   Application.Run;
  34. end.
  35.  

I'd appreciate any assistance you may provide.
Thank you.

molly

  • Hero Member
  • *****
  • Posts: 1564
windres is part of fpc (and should be located inside its platform dependent directory), in my particular Free pascal specific case: G:\WinDev\FPC\3.0.0\bin\i386-win32\windres.exe

Since you've installed Lazarus 1.6 (assuming release candidate there), you should be able to find it inside your FPC (3.0) directory.

When you started lazarus for the first time, was it able to find you fpc and fpc sources directory ?

Other then that, i don't think it is necessary anymore to use the include solution you presented in your code.
« Last Edit: March 04, 2016, 03:38:16 pm by molly »

apostleofchrist

  • New member
  • *
  • Posts: 21
Thank you for you reply molly.

It's not a RC version. It's the stable one. I did what I always do: I downloaded and installed it.
But the windres.exe is nowhere inside lazarus folder [C:\lazarus]

Could be something missing in the installer package? That's really odd.

molly

  • Hero Member
  • *****
  • Posts: 1564
if you start your lazarus (select an new empty project) and select the menu-item: view/IDE internal/About FPC does it then show the correct Free Pascal version / directory for you ?

It could be that there is some residue left from an old installation somewhere (configuration file pointing to wrong location(s) or a path out of the ordinary).

apostleofchrist

  • New member
  • *
  • Posts: 21
Hey molly.

I've checked the configuration as you told, and this is what I found about FPC:

Code: Pascal  [Select]
  1. Global IDE options:
  2. LazarusDirectory=
  3. Resolved LazarusDirectory=C:\lazarus\
  4. Project's CompilerFilename=$(CompPath)
  5. Resolved Project's CompilerFilename=C:\lazarus\fpc\3.0.0\bin\x86_64-win64\fpc.exe
  6. Default CompilerFilename=C:\lazarus\fpc\3.0.0\bin\x86_64-win64\fpc.exe
  7. Resolved default compilerFilename=C:\lazarus\fpc\3.0.0\bin\x86_64-win64\fpc.exe
  8. CompilerMessagesFilename=
  9. Resolved CompilerMessagesFilename=C:\lazarus\components\codetools\fpc.errore.msg
  10.  

But here's the thing: There weren't leftover from previous version, since I deleted the lazarus folder before doing a new instalation and during the instalation I checked the option which asks about cleaning any previous user configuration.

I've just searched the entire C: drive and have found two of these windres files. One is called i386-win32-windres and it is located in C:\lazarus\fpc\3.0.0\bin\x86_64-win64 and the other is called windres and it is located in C:\Program Files (x86)\CodeBlocks\MinGW\bin.

Which one is to be used and how do I tell the IDE to locate it?

molly

  • Hero Member
  • *****
  • Posts: 1564
Ok, thanks for the research and reporting back.

I didn't know windres was named differently depending on the target (it isn't for my out of the ordinary platform targets).

The correct one should be the one located inside C:\lazarus\fpc\3.0.0\bin\x86_64-win64.

I have no idea why fpc/lazarus doesn't add the missing binutils prefix. Are you actually trying to cross-compile ? (windows 32 and 64 bit are two separate targets, afaik usually one cross compiles from a 32 bit installation to win64, not the other way around)

If all else fails, try to rename the .exe (or make a copy and rename that as windres.exe) and see if that at least compiles your example..
« Last Edit: March 04, 2016, 04:39:37 pm by molly »

apostleofchrist

  • New member
  • *
  • Posts: 21
Thank you for you help. I'll just remove and reinstall lazarus. Then I'll do what you told.
I'll report back to you soon.

molly

  • Hero Member
  • *****
  • Posts: 1564
In case you opted for installing the 32-bit version of lazarus, then please don;t forget to install the 64 bit cross compiler from this link: https://sourceforge.net/projects/freepascal/files/Win32/3.0.0/

You'd also need the Free Pascal 3.0 sources to be located inside your FPC directory, they can be found here: https://sourceforge.net/projects/freepascal/files/Source/3.0.0/ (use the normal version, not the build version. .zip or .tar.gz depends on what you are able to extract)

In case you install the 64-bit version of lazarus and want to cross-compile 32 bit windows you'd also need to install this file here https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%201.6/ named Lazarus-1.6.0-fpc-3.0.0-cross-i386-win32-win64.exe

Either way: changing the target inside your project options then should select the proper locations and filename prefixes automatically for you. In case it doesn't then i suspect something to be amiss.
« Last Edit: March 04, 2016, 05:10:00 pm by molly »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4218
    • wiki
Please see http://bugs.freepascal.org/view.php?id=29698


i386-win32-windres comes with the 32 bit crosscompiler (it is probably not used, or wouldnt be if there was a proper named one)

Those tools are copied from the fpc svn. No idea why the windres is not included.

molly

  • Hero Member
  • *****
  • Posts: 1564
ah, i see. thanks Martin_fr. I completely missed that  :-[

@apostleofchrist
Forget my ramblings, just install as you would like to and in case installing 64 bit version, use the files located at the link Martin_fr posted.
« Last Edit: March 04, 2016, 05:14:04 pm by molly »

apostleofchrist

  • New member
  • *
  • Posts: 21
Hello Martin. molly.

That's precisely my point. See, I did all steps as molly told me.

lazarus-1.6.0-fpc-3.0.0-win64 <- Install this one first.
lazarus-1.6.0-fpc-3.0.0-cross-i386-win32-win64 <- then this one.

The I installed ZeosLib, which I use in my project. No errors, installed just fine.

Then I renamed the i386-win32-windres to windres. Tried to build the project, it failed.

Here's the message.
Code: Pascal  [Select]
  1. Warning: windres: preprocessing failed.
  2. epassdist.lpr(34,1) Error: Error while compiling resources -> Compile with -vd for more details. Check for duplicates.
  3.  

molly

  • Hero Member
  • *****
  • Posts: 1564
This time the error is slightly different ;-)

windres is located, but it seems that there is a resource related issue. Please use the windres from the bugreport though.

i would do as suggested and compile with -vd to see what is the culprit. Project options, compiler options, verbosity then on the right check mark the "show debug info" option and attempt to recompile (more information should be showed if not mistaken and would help pinpoint the issue)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4218
    • wiki
Do you also have gcc and cpp? they are called by windres?

They are in the zip, on the issue I linked.

apostleofchrist

  • New member
  • *
  • Posts: 21
You know what? I'm just getting back to the previous version.

I don't have the time or the patience to fix these problems. I just want to install and use it, as I always did since the first version. Maybe in future releases, these bugs might be fixed.

Thank you all for your kindness and help.

apostleofchrist

  • New member
  • *
  • Posts: 21
Greetings Lazarus Team!

I'd like to know if there's a timetable for correcting Lazarus 1.6 installation issues, like this one I posted.

Thank you for listening.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus