Topic: BUILD prob with 'sf_default_resource.rc'

Using Windows SF 2.41.2559 under WINE in Linux Mint:

After BUILD has successfully compiled all source files, I am getting this error message and the process fails before any object files get linked:

Processing default resource
Can't recognise 'C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gcc.exe -E -xc -DRC_INVOKED  build64\sf_default_resource.rc' as an internal or external command, or batch script.
C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\windres.exe: preprocessing failed.
Error: Last command making (build64\sf_default_resource.res) returned a bad status
Error: Make execution terminated

* Failed *

The relevant part of the Makefile seems to be,

"build64\sf_default_resource.res": "build64\sf_default_resource.rc"
    @echo Processing default resource
    @$(WRC) build64\sf_default_resource.rc $(RCFLAGS) -o build64\sf_default_resource.res

I have tried using Options>Project and clicking on the icon gadget to add the correct icon file.  The icon doesn't then appear on the gadget face but no error message is triggered by the attempt.

Any suggestions anyone?
---
John

Re: BUILD prob with 'sf_default_resource.rc'

John,

It sounds like windres.exe is failing on Linux under WINE for whatever reason.  I'll have to figure out why that is occurring, but windres.exe has significant problems with paths.

In the meantime, I would suggest simply disabling the Windows GUI option in Project Options.  Your executable won't have an icon, but it will at least compile properly since it shouldn't be invoking the resource compiler.

Jeff Armstrong
Approximatrix, LLC

Re: BUILD prob with 'sf_default_resource.rc'

I have
- un-ticked the GUI option,
- saved the project,
- CLEANed the build,
- exited from SF,
- re-started SF,
- checked options, GUI still unticked,
- re-run BUILD.

Build status display:

===========================
Generating Makefile... Okay
===========================
Compiling ..\Source\MODULES\mM.for
Compiling ..\Source\MODULES\mParams.for
Compiling ..\Source\MODULES\mRestr.for
Compiling ..\Source\addlod.for
:
:
: [many]
:
:
Compiling ..\Source\WinINIT.for
Compiling ..\Source\WinMenus.for
Compiling ..\Source\WinSCR.for
Processing default resource
Can't recognise 'C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gcc.exe -E -xc -DRC_INVOKED  build64\sf_default_resource.rc' as an internal or external command, or batch script.
C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\windres.exe: preprocessing failed.
Error: Last command making (build64\sf_default_resource.res) returned a bad status
Error: Make execution terminated

* Failed *

Relevant Makefile extracts:

#
# Automagically generated by Approximatrix Simply Fortran 2.41
#
FC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gfortran.exe"
CC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\gcc.exe"
AR="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\ar.exe"
WRC="C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin\windres.exe"
RM=rm -f

IDIR=-IZ:/home/john/DEV/IOlibWin/Win.SF/modules64 
# warning - directory error: ..\IOlibWin\modules64
:
:
:

"build64\WinMenus.o": "..\Source\WinMenus.for" "modules64\drw.mod" "modules64\loading.mod" "modules64\m.mod" "modules64\materials.mod" "modules64\members.mod" "modules64\nodes.mod" "modules64\params.mod" "modules64\properties.mod" "modules64\restraints.mod" "modules64\winstuff.mod"
    @echo Compiling ..\Source\WinMenus.for
    @$(FC) -c -o "build64\WinMenus.o" $(FFLAGS) "..\Source\WinMenus.for"

"build64\WinSCR.o": "..\Source\WinSCR.for" "modules64\loading.mod" "modules64\materials.mod" "modules64\members.mod" "modules64\nodes.mod" "modules64\params.mod" "modules64\properties.mod" "modules64\restraints.mod" "modules64\winstuff.mod"
    @echo Compiling ..\Source\WinSCR.for
    @$(FC) -c -o "build64\WinSCR.o" $(FFLAGS) "..\Source\WinSCR.for"


"build64\sf_default_resource.res": "build64\sf_default_resource.rc" "..\Icons\Icon64.ico"
    @echo Processing default resource
    @$(WRC) build64\sf_default_resource.rc $(RCFLAGS) -o build64\sf_default_resource.res

clean: .SYMBOLIC
    @echo Deleting build64\addlod.o and related files
    @$(RM) "build64\addlod.o"
    @echo Delet... . .
:
:

---
John.

Re: BUILD prob with 'sf_default_resource.rc'

John,

You'll need to remove the icon from the project too.  I believe you might have to:

1. Check Windows GUI in Project Options
2. Click the icon
3. Select Cancel in the file dialog
4. Uncheck Windows GUI

Selecting Cancel in the file dialog should "un-choose" an icon, but it might not.  There could be a bug where the program is stuck with an icon forever without a manual change to the project file itself.  I can fix that manually for the time being if you need me to.

Jeff Armstrong
Approximatrix, LLC

Re: BUILD prob with 'sf_default_resource.rc'

Thanks for the lightning fast reply Jeff.

I've followed your four-point list but it made no difference.
What might be relevant is that the icon panel in Project options is always blank.  When I add an icon, and when I add no icon and just press 'cancel', in both cases, it always shows blank.

Perhaps it's relevant that, when I tick the GUI box and click to add an icon, the file dialog box always opens in the folder containing the .prj file, and I have to navigate up on level then down a level into an Icons folder, to select a .ico file.

My Linux Mint file structure is as follows, for 32-bit and 64-bit, using SF-linux and SF-Windows, all sharing the same source files.  This is why I have to climb up the folder tree to find the icon.ico files.  Could this be why the SF-Windows [WINE] project options is showing blank icons?  When using SF-Linux, of course, there is no icon selector so this doesn't arise.  I haven't checked what happens if the icon file isn't in the .prj file folder, when using a Windows laptop.  Should I do so and let you know?

File structure

PROJECT FOLDER <-- with the project name

  > SourceFiles
     > Current
     > Recent
     > Modules

  > TestDataFiles

  > Icons

  > Lin.SF
     > Build64
     > Modules64
     > Makefile64
     > Projectfile64.prj  <-- with the project name
     > Build32
     > Modules32
     > Makefile32
     > Projectfile32.prj  <-- with the project name
     > Otherstuff

  > Win.SF   <-- When using SF with WINE
     > Build64
     > Modules64
     > Makefile64
     > Projectfile64.prj  <-- with the project name
     > Builf32
     > Modules32
     > Makefile32
     > Projectfile32.prj  <-- with the project name
     > Otherstuff

  > Other stuff
-----
John

Re: BUILD prob with 'sf_default_resource.rc'

John,

The issue is with the resource compiler not working properly for whatever reason.  That program has always been highly problematic.  What the resource compiler can't seem to find is the C compiler, which is necessary to preprocess the resource file.  The icon's location is not part of the problem at all.  The location of the C compiler is also not the problem.  The entire problem is confined to the resource compiler's poor handling of paths and process creation.  It's a bug that seems to be manifesting itself only under WINE.

The fact that Simply Fortran is mishandling the icon's presence or absence, though, is a bug.  I'll need to look at that as it should be an easy fix.  Fixing the resource compiler is not an easy fix, though, and will require more time.

Jeff Armstrong
Approximatrix, LLC

Re: BUILD prob with 'sf_default_resource.rc'

John,

I still haven't had a chance to go back and look at why the resource compiler is having trouble launching the C preprocessor under WINE.  I do have it on my To-Do list, however.  I didn't want you to think I had forgotten.

Jeff Armstrong
Approximatrix, LLC

Re: BUILD prob with 'sf_default_resource.rc'

Jeff,  not for a picosecond would anyone on this forum suppose you to be inattentive to matters raised here! 

But thank you!
---
John