Cross Compiling win64 from Linux issues with resource compiler lazarus / 1-Linux ---------------------------------------------------------------------- snorkel · 2014-07-02 21:51 Has anyone got the win64 cross compiler on linux to use the mingw 64bit windres? When I cross compile my app that uses a resource I get this: Calling resource compiler "/usr/bin/x86_64-win64-gorc" with "/machine x64 /nw /ni /r /fo /home/snorkel/lazarus_projects/sft_admin_new/lib/x8 6_64-win64/updater.res /home/snorkel/lazarus_projects/sft_admin_new/updater.rc" as command line This after I did: ln -s /usr/bin/x86_64-w64-mingw32-windres /usr/bin/x86_64-win64-gorc because the ide complained it could not find x86_64-win64-gorc. This is on latest stable Lazarus and FPC 2.6.4.  If I manually run the mingw 64bit windres from the command line it works fine, it's just the IDE is butchering the command line when it tries to call it. Anyone have ideas? ---------------------------------------------------------------------- Leledumbo · 2014-07-02 21:58 Resource compiler is called by the compiler, not the IDE. QuoteCalling resource compiler "/usr/bin/x86_64-win64-gorc" with "/machine x64 /nw /ni /r /fo /home/tcaduto/lazarus_projects/sft_admin_ new/lib/x86_64-win64/updater.res /home/tcaduto/lazarus_projects/sft_admin_new/updater.rc" as command lineshould only be an info, not a warning or even error. ---------------------------------------------------------------------- snorkel · 2014-07-02 22:10 Well, I added this to the fpc.cfg: -FCx86_64-w64-mingw32-windres and the IDE reports this now.  A bit different than before: Calling resource compiler "/usr/bin/x86_64-w64-mingw32-windres" with "/machine x64 /nw /ni /r /fo /home/snorkel/lazarus_projects/sft_admin_ new/lib/x86_64-win64/updater.res /home/snorkel/lazarus_projects/sft_admin_new/updater.rc" as command line windres [option(s)] [input-file] [output-file] windres: supported targets: pe-x86-64 pei-x86-64 elf64-x86-64 elf64-l1om elf64-k1om pe-i386 pei-i386 elf32-i386 elf64-little elf64-big elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex Compiling resource /home/snorkel/lazarus_projects/sft_admin_new/updater.rc sftadmin.lpr(59,1) Error: Error while compiling resources. Compile with -vd for more details. Check for duplicates. sftadmin.lpr(59,1) Fatal: There were 1 errors compiling module, stopping The command line the compiler is generating is not correct.  I have no idea where it's pulling /machine x64 /nw /ni /r /fo /home/snorkel/laza rus_projects/sft_admin_new/lib/x86_64-win64/updater.res /home/snorkel/lazarus_projects/sft_admin_new/updater.rc ---------------------------------------------------------------------- Leledumbo · 2014-07-03 03:45 I believe the compiler expects gorc, and its options aren't compatible with windres which is used to compile resources on win32. windres is a gnu tool which uses - / -- for option, while gorc uses windows style /. thus, you cannot symlink windres to gorc. ---------------------------------------------------------------------- snorkel · 2014-07-03 15:20 well, that kind of sucks.  oh well, I guess I can just manually build the .res file as it does not change that often. Or maybe tell the compiler to use a python script  and read the params in and then call the mingw 64bit windres with the params in the correct order. or use Wine and actually use the gorc from windows. ---------------------------------------------------------------------- snorkel · 2014-07-03 16:22 I built the .res file manually from command line /usr/bin/x86_64-w64-mingw32-windres /home/snorkel/lazarus_projects/sft_admin_new/updater.rc /home/snorkel/lazarus_projects/sft_admin_new/updater64.res and then did this:  {$R *.res}  {$IFDEF Windows}      {$ifdef WIN64}         {$R updater64.res}      {$else}           {$R updater.rc}      {$ENDIF}  {$ENDIF} Works ok now.  Is there a way to tell the compiler what resource compiler to use through the compiler directives? ---------------------------------------------------------------------- Leledumbo · 2014-07-03 21:45 Quote from: snorkel on July 03, 2014, 06:22:22 pmIs there a way to tell the compiler what resource compiler to use through the compiler directives? From t_win.pas source of the compiler, seems not: Code: [Select]const     res_gnu_windres_info : tresinfo =         (           id     : res_gnu_windres;           resbin : 'fpcres';           rescmd : '-o $OBJ -a $ARCH -of coff $DBG';           rcbin  : 'windres';           rccmd  : '--include $INC -O res -D FPC -o $RES $RC';           resourcefileclass : nil;           resflags : [];         );     res_win64_gorc_info : tresinfo =         (           id     : res_win64_gorc;           resbin : 'fpcres';           rescmd : '-o $OBJ -a $ARCH -of coff $DBG';           rcbin  : 'gorc';           rccmd  : '/machine x64 /nw /ni /r /d FPC /fo $RES $RC';           resourcefileclass : nil;           resflags : [];         );As you can see, both the binary name and arguments are hard coded.