vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.79k stars 2.16k forks source link

Support for MSYS builds on windows 10 #3562

Closed gshields closed 4 years ago

gshields commented 4 years ago

I had to move from Mingw to Msys on windows 10. I use to build with gcc under Mingw and would like to do the same with Msys. Thanks

nodrygo commented 4 years ago

v work for me with Msys gcc except for graphical parts (tetris ou ui) fail with

$ v run tetris.v
f'
collect2.exe: error: ld returned 1 exit statusV error: C error. This should never happen.
Please create a GitHub issue: https://github.com/vlang/v/issues/new/choose

even with copy of dependencies

 cp /c/v/thirdparty/glfw/glfw3.dll .
git clone --depth=1 https://github.com/ubawurinna/freetype-windows-binaries /c/v/thirdparty/freetype/
vitalyster commented 4 years ago

MSYS is not a compiler, it is just a bash shell with GNU environment (and you can switch compiler changing /mingw mount path in /etc/fstab). V supports build from MSYS shell (with main Makefile), make CC=gcc builds V successfully for me. For examples with glfw dependencies you need to provide correct glfw binary for your compiler. To make sure you have correct glfw build it is better to rebuild it from the same environment

nodrygo commented 4 years ago

gcc and make are installed and working and I have rebuild v.exe with but yes I will try to rebuilt glfw because not tested

$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-9.2.0/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 --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++ --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --enable-plugin --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev2, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
Thread model: posix
gcc version 9.2.0 (Rev2, Built by MSYS2 project)
vitalyster commented 4 years ago

You can try to use x86_64 glfw binary distribution first and take libglfw3.a from there

nodrygo commented 4 years ago

thanks for your answers I have rebuild everything but as I work in a Virtualbox but now I have this problem probably related to vbox

$ ./tetris.exe
failed to create a glfw window, make sure you have a GPU driver installed
create window wnd=0000000000000000 ptr==0000000200000001
Failed to initialize glad OpenGL context

so presently I will stick with go/gotk3 not easy to install but working fine ;-) hope to see v working as fine on my vbox windows in some days as it work on my linux today V remain a great project congrats everybody