-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Cross Compliation from Windows for Linux target fails #2382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
BTW, cross compilation of the same program from Linux to Windows also seems to break:
( |
If you have working cross-compiler Windows->Linux in PATH, for example |
That doesn't work for me. > $ v --cc x86_64-w64-mingw32-gcc fibrec.v
/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -ldl
collect2: error: ld returned 1 exit status
V error: C error. This should never happen. Please create a GitHub issue: https://github.com/vlang/v/issues/new/choose Incidentally, to test, since it's a similar project, I tried cross-compilation with Nim via This at least lets me know that my machine has the proper toolchain to build cross platform executables. |
Yes, something broken for now, but here is the trick: |
That does work. Thanks for the elaboration. EDIT: The executable is created, and can be executed, but never prints the output... 🤔 output of $ ldd ./fib_rec.exe
ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x7ff827db0000)
KERNEL32.DLL => /c/Windows/system32/KERNEL32.DLL (0x7ff827ab0000)
KERNELBASE.dll => /c/Windows/system32/KERNELBASE.dll (0x7ff825290000)
msvcrt.dll => /c/Windows/system32/msvcrt.dll (0x7ff826440000) |
Known issue with msvcrt.dll, you need to configure mingw with gcc specs to link msvcr90 or later, or comment out _O_U8TEXT line in V code and rebuild (and obviously loose utf-8 support) |
Alright. Thanks for the info. |
I got the same issues, counld you share your idea? |
Actual V (0.3.2) has another problem with this code, but with Clang compiler. Logged here - #17032 |
Can you try again? |
V version: V 0.1.21 69b4594
OS: Windows 8
What did you do?
What did you expect to see?
successful build of fib_rec program for Linux target.
What did you see instead?
The text was updated successfully, but these errors were encountered: