Hi!
I have a python code embeded in go (refer: Usage python in GO code – # 6 by gucio321)
However I have actually a given up essential issue – I require to deliver my application to home windows as well as I am incapable to construct it on/for this system.
on home windows
I am geting “Python.h” – data not discovered mistake although I included pkg-config as well as python setup.
on linux
I was attempting to cross-compile with the complying with manuscript:
#!/ bin/bash.
#.
ecoh "construct for home windows".
LD_LIBRARY_PATH="/ usr/x86 _ 64-w64-mingw32/ sys-root/mingw/lib" PKG_CONFIG_PATH="/ usr/x86 _ 64-w64-mingw32/ sys-root/mingw/lib/ pkgconfig/" GOOS= home windows GOARCH= amd64.
CGO_ENABLED= 1.
CC= x86_64-w64-mingw32-gcc CXX= x86_64-w64-mingw32-g++.
go construct.
- ldflags "- s -w -extldflags=- fixed".
- o main.go.
anyhow, I’m obtaining the complying with linker mistake:
/ usr/local/go/ pkg/tool/linux _ amd64/link: running x86_64-w64-mingw32-g++ fell short: departure condition 1.
/ usr/lib/gcc/ x86_64-w64-mingw32/ 12.2.1/././././ x86_64-w64-mingw32/ bin/ld: can not discover -lpython3.10: No such data or directory site.
/ usr/lib/gcc/ x86_64-w64-mingw32/ 12.2.1/././././ x86_64-w64-mingw32/ bin/ld: missing inappropriate/ usr/i686-w 64-mingw32/ sys-root/mingw/lib/ libimm32.a when looking for -limm32.
/ usr/lib/gcc/ x86_64-w64-mingw32/ 12.2.1/././././ x86_64-w64-mingw32/ bin/ld: missing inappropriate/ usr/i686-w 64-mingw32/ sys-root/mingw/lib/ libimm32.a when looking for -limm32.
/ usr/lib/gcc/ x86_64-w64-mingw32/ 12.2.1/././././ x86_64-w64-mingw32/ bin/ld: can not discover -lpython3.10: No such data or directory site.
/ usr/lib/gcc/ x86_64-w64-mingw32/ 12.2.1/././././ x86_64-w64-mingw32/ bin/ld: missing inappropriate/ usr/i686-w 64-mingw32/ sys-root/mingw/lib/ libgdi32.a when looking for -lgdi32.
/ usr/lib/gcc/ x86_64-w64-mingw32/ 12.2.1/././././ x86_64-w64-mingw32/ bin/ld: missing inappropriate/ usr/i686-w 64-mingw32/ sys-root/mingw/lib/ libgdi32.a when looking for -lgdi32.
/ usr/lib/gcc/ x86_64-w64-mingw32/ 12.2.1/././././ x86_64-w64-mingw32/ bin/ld: missing inappropriate/ usr/i686-w 64-mingw32/ sys-root/mingw/lib/ libopengl32.a when looking for -lopengl32.
/ usr/lib/gcc/ x86_64-w64-mingw32/ 12.2.1/././././ x86_64-w64-mingw32/ bin/ld: missing inappropriate/ usr/i686-w 64-mingw32/ sys-root/mingw/lib/ libopengl32.a when looking for -lopengl32.
/ usr/lib/gcc/ x86_64-w64-mingw32/ 12.2.1/././././ x86_64-w64-mingw32/ bin/ld: missing inappropriate/ usr/i686-w 64-mingw32/ sys-root/mingw/lib/ libopengl32.a when looking for -lopengl32.
/ usr/lib/gcc/ x86_64-w64-mingw32/ 12.2.1/././././ x86_64-w64-mingw32/ bin/ld: missing inappropriate/ usr/i686-w 64-mingw32/ sys-root/mingw/lib/ libopengl32.a when looking for -lopengl32.
/ usr/lib/gcc/ x86_64-w64-mingw32/ 12.2.1/././././ x86_64-w64-mingw32/ bin/ld: missing inappropriate/ usr/i686-w 64-mingw32/ sys-root/mingw/lib/ libopengl32.a when looking for -lopengl32.
/ usr/lib/gcc/ x86_64-w64-mingw32/ 12.2.1/././././ x86_64-w64-mingw32/ bin/ld: missing inappropriate/ usr/i686-w 64-mingw32/ sys-root/mingw/lib/ libopengl32.a when looking for -lopengl32.
collect2: mistake: ld returned 1 departure condition.
idk which mistake would certainly be much easier to take care of
Did you additionally assemble Python for Windows?
I have actually mingw32-python plan mounted, i mean it offers home windows collection of python, nevertheless I’m unsure if this collection is made use of tbh
Perhaps your ldflags requires a - L
flag to define the directory site to python310.dll? Likewise, I assume it’s python 310 dll for home windows, however libpython 3.10 so for every little thing else (based upon the components of my C: Program FilesPython310 folder on my computer system).