Closed fsinisi90 closed 5 years ago
@fsinisi90, does it work when you build using 32bit mingw? I'm confused why your gcc shows linux target (x86_64-linux-gnu
); are you trying to cross-compile to get Windows executable?
The Windows scripts have been written to build 32bit executables, although some parts have also been tested on 64bit builds (luasocket, luasec, and few others). I'm not sure why it complaints about -mwindows
, but will check.
I just tested with 64bit mingw and it worked without issues using the same build script.
Here is my gcc version (I'm using one from msys2):
Target: x86_64-w64-mingw32
Configured with: ../gcc-4.9.2/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --with-gxx-include-dir=/mingw64/include/c++/4.9.2 --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-cloog-backend=isl --enable-version-specific-runtime-libs --disable-cloog-version-check --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-cloog=/mingw64 --with-pkgversion='Rev5, Built by MSYS2 project' --with-bugurl=http://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
gcc version 4.9.2 (Rev5, Built by MSYS2 project)
(I'm using this fairly old one, as it's been producing better executable sizes than the more recent ones)
@pkulchenko you're right, I was trying to cross-compile it when I could compile it on Windows directly. I've installed MinGW on Windows following this steps and I was able to generate a new .exe successfully.
BTW it's a .sh script and it has a rm
command inside, wasn't it supposed to be executed on Linux?
it's a .sh script and it has a rm command inside, wasn't it supposed to be executed on Linux?
I use msys2, which provides rm
and other "unix" tools. Should probably change it to del
, but then cp
, sed
and others would need to be updated as well. It may be easier just to have msys or similar environment installed.
I'm closing the ticket since it's resolved, but feel free to continue the discussion as needed.
I'm trying to generate a new .exe file, so I'm running only this part of the build-win32.sh script:
I've installed mingw:
And then run:
gcc version: