PackageCompiler fails on example, windows/mingw

I am getting an error from mingw of missing files when running create_app on the demo application for PackageCompiler found MyApp

Specifically:

julia> using PackageCompiler

julia> create_app("MyApp", "MyCompiledApp")
[ Info: PackageCompiler: creating base system image (incremental=false)...
[ Info: PackageCompiler: creating system image object file, this might take a while...
c:\mingw-w64\mingw64\bin/ld.exe: cannot find dllcrt2.o: No such file or directory
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -lmingw32
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -lgcc_s
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -lmoldname
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -lmingwex
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -lmsvcrt
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -lpthread
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -ladvapi32
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -lshell32
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -luser32
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -lkernel32
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -liconv
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -lmingw32
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -lgcc_s
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -lmoldname
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -lmingwex
c:\mingw-w64\mingw64\bin/ld.exe: cannot find -lmsvcrt
collect2.exe: error: ld returned 1 exit status

I am on Windows 10. I have tried this with different compilers, mingw-64, mingw-64 from winbuilds, 32-bit mingw (different error) and let PackageCompiler download and install mingw64 on its own.

I was able to get it working. I had to remove all existing compilers (mingw, cygwin) from my path, remove library_path env variables, and delete the artifact from .julia that contained the mingw compiler. This caused julia to redownload the compiler with all the libraries needed.

1 Like