I tried it and it does not work. I installed Julia 1.12 beta1 and when i try then
julia juliac.jl
it cannot find the file juliac.jl. So one has to specify the complete paths. In my case it would be
J:\\Julia-1.12\\bin\julia.exe J:\\Julia-1.12\\share\\julia\\juliac.jl --output-exe hello --trim D:\\usti\\Julia\\JuliaC\\helloworld.jl
and the content of helloworld.jl is just:
module HelloWorld
Base.@ccallable function main()::Cint
println(Core.stdout, "Hello, World!")
return 0
end
end # End of module HelloWorld
The error I get is
LoadError: IOError: could not spawn `cc -std=gnu11 '-IJ:\Julia-1.12\include\julia' -g -c -o 'C:\Users\Uwe\AppData\Local\Temp\jl_UOF4T3\init.a' 'C:\Users\Uwe\AppData\Local\Temp\jl_UOF4T3\init.c'`: no such file or directory (ENOENT)
But I have no info why init.a was not created.
I also wonder how I specify the path to the C compiler. I have Microsoft Visual Studio as C/C++ compiler. But how to I tell Julia its path?