PackageCompiler: issue with .exe file


#1

Hi all,

I create an .exe file with Build_Executable function from PackageCompiler. It works very well if I run it from my computer. If I want to share the executable file and run it on another computer it doesnt work. I get this error message

fatal: error thrown and no exception handler available.
#
rec_backtrace at /home/Administrator/buildbot/worker/package_win64/build/src\stackwalk.c:94
record_backtrace at /home/Administrator/buildbot/worker/package_win64/build/src\task.c:217 [inlined]
jl_throw at /home/Administrator/buildbot/worker/package_win64/build/src\task.c:417
jl_errorf at /home/Administrator/buildbot/worker/package_win64/build/src\rtutils.c:77
jl_load_dynamic_library at /home/Administrator/buildbot/worker/package_win64/build/src\dlload.c:197
jl_get_library at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\runtime_ccall.cpp:50
jl_load_and_lookup at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\runtime_ccall.cpp:61
jlplt_g_type_init_7094 at C:\Users\fv973uv\Desktop\Executable\IFRS17.dll (unknown line)
init__gtype at C:\Users\mehdi.barbouche.julia\packages\Gtk\RwVPb\src\GLib\signals.jl:329
init at C:\Users\mehdi.barbouche.julia\packages\Gtk\RwVPb\src\GLib\signals.jl:392
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2219
jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1571 [inlined]
jl_module_run_initializer at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:72
_julia_init at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\init.c:832
.text at C:\Users\fv973uv\Desktop\Executable\IFRS17.exe (unknown line)
__tmainCRTStartup at /home/abuild/rpmbuild/BUILD/mingw-w64-crt\crt\crtexe.c:339
mainCRTStartup at /home/abuild/rpmbuild/BUILD/mingw-w64-crt\crt\crtexe.c:223
BaseThreadInitThunk at C:\Windows\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\Windows\SYSTEM32\ntdll.dll (unknown line)

any help?


#2

Hi,
To run a compiled julia executable on another machine, you’ll have to transfer the julia runtime libraries in addition to the exe itself. The new machine will have to be able to find a compatible libjulia.dll (in the lib directory of your julia installation) and all the dlls in the lib/julia directory if I’m not mistaken.


#3

Looks like you are trying to build a package that uses Gtk. I’ve managed to relocate a Gtk application on mac OS but it’s not straightforward. The issue is that you need to move all the Gtk’s dll and external file in addition to the Julia ones. And the relative/absolute paths need to be correct. On mac OS you can modify libraries that depends on others to modify their paths, I’m not sure how it works on windows.

Other Julia packages might have similar issues, there’s sometimes hard-coded absolute paths that need to be taken care of.

There’s an example in ApplicationBuilder with SDL:

And I have this build script for mac OS, I’m not 100% sure it’s up to date though: