When I attempt to run go get -u -v github.com/Drakirus/go-flutter-desktop-embedder on Windows, following your instructions, I get the following error:
c:/winbuilds/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lflutter_engine
collect2.exe: error: ld returned 1 exit status
I did run the flag command from your instructions first.
Am I doing something wrong?
When you run go get -u -v github.com/Drakirus/go-flutter-desktop-embedder golang will try to compile the project. (certainly for caching purposes)
So it's doesn't mater if it fail during go get.
Does the error occurs when building the simpleDemo ?
Yeah the same problem happens when I run go build.
I did set the path in the main.go file, maybe I did it wrong though?
Is it supposed to be
gutter.OptionICUDataPath("/opt/flutter/bin/cache/artifacts/engine/windows-x64/icudtl.dat"),
or
gutter.OptionICUDataPath("/flutter/bin/cache/artifacts/engine/windows-x64/icudtl.dat"),
Neither of those work for me. Do I need to set it to some specific path on my PC?
The linker dosn't seems to find the flutter_engine.dll , can you put the dll into the mingw64's lib folder ?
I did set the path in the main.go file, maybe I did it wrong though?
Is it supposed to be
gutter.OptionICUDataPath("/opt/flutter/bin/cache/artifacts/engine/windows-x64/icudtl.dat"),
or
gutter.OptionICUDataPath("/flutter/bin/cache/artifacts/engine/windows-x64/icudtl.dat"),
gutter.OptionICUDataPath is used at run time, so the error doesn't come from here.
Yes make sure the path to the windows-x64/icudtl.dat is valid, (Checkout your flutter's directory)
Yeah throwing it in with the mingw64 libs seems to work. Thanks.
The generated binary, uses the flutter_engine.dll located right next to it.
The project should stay portable. The flutter_engine.dll in the mingw64 libs is only used for compiling.
Thank for the feedback! :+1:
If you are using powershell you have to use a different syntax $env:CGO_LDFLAGS = "-LC:\......\simpleDemo" allows me to compile.
Most helpful comment
If you are using powershell you have to use a different syntax
$env:CGO_LDFLAGS = "-LC:\......\simpleDemo"allows me to compile.