1 (edited by JohnWasilewski 2014-12-20 00:15:55)

Topic: Gtk-Fortran examples: runtime crash 0xc000007b

I write to report a difficulty with the Gtk3-Fortran examples.
-----
On opening the Gtk3-Fortran examples, I saved the project file in a folder called "Gtk-F examples", with filename "Gtk-F examples.prj).

The first example, bazaar.f90 then compiled and built OK.
When I tried to run it, I received this error message:
Application error.  Unable to start correctly (0xc000007b).  Click OK to close the application. 

After closing, CLEANing and repeating, same result.

Next: I CLEANed again, then disabled bazaar.f9, enabled cairo-basics-click.f90, and tried to compile and build.  This gave a Make error:
==================================
Generating Makefile... Okay
==================================
Error(F37): Target (build\cairo-basics-click.o) is defined recursively
Error(E02): Make execution terminated
* Failed *

Next, CLEAN, disable cairo-basics-click.f90 and re-enable bazaar.f90, compile and build: AND THIS TIME, bazaar.f90 also fails to build (even though it did build before:
==================================
Generating Makefile... Okay
==================================
Error(F37): Target (build\bazaar.o) is defined recursively
Error(E02): Make execution terminated
* Failed *

So now examine the Makefile:
Here's the whole file:

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

IDIR=-IC:/Users/jwasilewski/AppData/Local///sfpm/32/include
# -I error: Directory C:\Program Files (x86)\Fortran\SF2\mingw-w64\include\ does not exist

LDIR=-LC:/PROGRA~2/Fortran/SF2/MINGW-~1/lib/ -LC:/Users/jwasilewski/AppData/Local///sfpm/32/lib


OPTFLAGS= -g

SPECIALFLAGS=-m32 $(IDIR)

RCFLAGS=-O coff -F pe-i386

PRJ_FFLAGS=

PRJ_CFLAGS=-mms-bitfields

PRJ_LFLAGS=-lgtk-3-fortran -lgtk-3.dll -lgdk-3.dll -lgthread-2.0.dll -lgdi32 -lole32 -latk-1.0.dll -lgdk_pixbuf-2.0.dll -lpangowin32-1.0.dll -lpango-1.0.dll -lcairo.dll -lcairo-gobject.dll -lgobject-2.0.dll -lgmodule-2.0.dll -lglib-2.0.dll -lintl.dll

FFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_FFLAGS) -Jmodules

CFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_CFLAGS)

"build\bazaar.o": ".\bazaar.f90"
    @echo Compiling .\bazaar.f90
    @$(FC) -c -o "build\bazaar.o" $(FFLAGS) ".\bazaar.f90"
"modules\my_widgets.mod" "modules\handlers.mod" : "build\bazaar.o" .EXISTSONLY
    @echo Compiling .\bazaar.f90
    @$(FC) -c -o "build\bazaar.o" $(FFLAGS) ".\bazaar.f90"

clean: .SYMBOLIC
    @echo Deleting build\bazaar.o and related files
    @$(RM) "build\bazaar.o" "modules\my_widgets.mod" "modules\handlers.mod"
    @echo Deleting build\cairo-basics-click.o and related files
    @$(RM) "build\cairo-basics-click.o"
    @echo Deleting build\cairo-basics.o and related files
    @$(RM) "build\cairo-basics.o"
    @echo Deleting build\cairo-tests.o and related files
    @$(RM) "build\cairo-tests.o"
    @echo Deleting build\hl_assistant.o and related files
    @$(RM) "build\hl_assistant.o"
    @echo Deleting build\hl_cairo1.o and related files
    @$(RM) "build\hl_cairo1.o"
    @echo Deleting build\hl_cairo_clock.o and related files
    @$(RM) "build\hl_cairo_clock.o"
    @echo Deleting build\hl_choosers.o and related files
    @$(RM) "build\hl_choosers.o"
    @echo Deleting build\hl_combo.o and related files
    @$(RM) "build\hl_combo.o"
    @echo Deleting build\hl_containers.o and related files
    @$(RM) "build\hl_containers.o"
    @echo Deleting build\hl_dialog.o and related files
    @$(RM) "build\hl_dialog.o"
    @echo Deleting build\hl_infobar.o and related files
    @$(RM) "build\hl_infobar.o"
    @echo Deleting build\hl_list1.o and related files
    @$(RM) "build\hl_list1.o"
    @echo Deleting build\hl_list_n.o and related files
    @$(RM) "build\hl_list_n.o"
    @echo Deleting build\hl_list_renderers.o and related files
    @$(RM) "build\hl_list_renderers.o"
    @echo Deleting build\hl_menu.o and related files
    @$(RM) "build\hl_menu.o"
    @echo Deleting build\hl_pbar.o and related files
    @$(RM) "build\hl_pbar.o"
    @echo Deleting build\hl_pbar_p.o and related files
    @$(RM) "build\hl_pbar_p.o"
    @echo Deleting build\hl_radio.o and related files
    @$(RM) "build\hl_radio.o"
    @echo Deleting build\hl_sliders.o and related files
    @$(RM) "build\hl_sliders.o"
    @echo Deleting build\hl_sliders2.o and related files
    @$(RM) "build\hl_sliders2.o"
    @echo Deleting build\hl_textview.o and related files
    @$(RM) "build\hl_textview.o"
    @echo Deleting build\hl_tree.o and related files
    @$(RM) "build\hl_tree.o"
    @echo Deleting build\julia_pixbuf.o and related files
    @$(RM) "build\julia_pixbuf.o"
    @echo Deleting build\list_demo.o and related files
    @$(RM) "build\list_demo.o"
    @echo Deleting build\mandelbrot.o and related files
    @$(RM) "build\mandelbrot.o"
    @echo Deleting build\mandelbrot_pixbuf.o and related files
    @$(RM) "build\mandelbrot_pixbuf.o"
    @echo Deleting build\mandelbrot_pixbuf_zoom.o and related files
    @$(RM) "build\mandelbrot_pixbuf_zoom.o"
    @echo Deleting build\menu.o and related files
    @$(RM) "build\menu.o"
    @echo Deleting build\notebooks.o and related files
    @$(RM) "build\notebooks.o"
    @echo Deleting default icon resource
    @$(RM) "build\default_icon.res"
    @echo Deleting gtk-fortran-ex.exe
    @$(RM) "gtk-fortran-ex.exe"

"gtk-fortran-ex.exe":  "build\bazaar.o"
    @echo Generating gtk-fortran-ex.exe
    @$(FC) -o "gtk-fortran-ex.exe" -static -m32 -mwindows "build\bazaar.o" $(LDIR) $(PRJ_LFLAGS)

all: "gtk-fortran-ex.exe" .SYMBOLIC
----
End of report
---
John

Re: Gtk-Fortran examples: runtime crash 0xc000007b

John,

The error you're seeing originally (0xc000007b) is probably related to the icon in the GTK+ for some reason.  I don't have an explanation for that as I don't seem to be getting that issue.  You could try disabling the icon.

The recursive definition appears to be another bug related to dependency checks in Simply Fortran.  All the files in the GTK+ examples create a module "handlers" that seems to not be cleared/redefined properly when files are activated/deactivated.  I'll have a fix for it this afternoon.

Jeff Armstrong
Approximatrix, LLC

Re: Gtk-Fortran examples: runtime crash 0xc000007b

If you mean, in project options, de-select whatever icon image appears at the RHS of the options dialog box, well there was no icon selected.  The icon image panel is blank.

I've also tried de-selecting the Windows GUI option. 
For me, it still crashes at runtime, with "Unable to start correctly (0xc000007b)".
---
John

Re: Gtk-Fortran examples: runtime crash 0xc000007b

John,

While I was hoping the error was only due to a bad resource file, it sounds more complicated.  The error "0xc000007b" actually means that the program is a "bad image format," but that description is misleading.  It is most likely due to a DLL issue on the system.  The DLL issue may be caused by the GTK+ libraries themselves, but I can't replicate the issue at this time.  I will continue trying to do so, however.  Searching the Internet for this exact error message turns up countless explanations and solutions, none of which are guaranteed to work.

Jeff Armstrong
Approximatrix, LLC

Re: Gtk-Fortran examples: runtime crash 0xc000007b

I've tried replacing C:\Windows\SysWOW64\msvcp110.dll.
It didn't cure the problem.
---
J.

Re: Gtk-Fortran examples: runtime crash 0xc000007b

..and I've tried simply deleting C:\Windows\SysWOW64\msvcp110.dll.
That didn't cure the problem either.
---
J.

Re: Gtk-Fortran examples: runtime crash 0xc000007b

John,

A new build (1781) of version 2.18 is now available from the Download page that should fix the dependency issue.  I still need to work out the problem you've reported with the Windows error.  I can't yet reproduce it.

Jeff Armstrong
Approximatrix, LLC

Re: Gtk-Fortran examples: runtime crash 0xc000007b

Thanks Jeff.  I can confirm that SF2.18.1781 has cured the problem of error(F37): recursively defined object files.

I am still getting the 0xc000007b runtime crashes, , but its only this which is going wrong now, so  I've changed the topic name to refer only to this problem.

I have tried and tried to find a way to make one of the Gtk3+ Fortran examples run for me, and I know you've also been grinnding away at this same problem but, if you can't even reproduce it, this is a big hindrance.

I'll email my project directory for the Gtk3 Fortran examples, so you can see how the Package Manager set it up on my laptop, in case there are any clues to be had from this.

My laptop, by the way, has Win7 64-bit.
---
John