![]() ![]() ![]() usr/local/Cellar/mingw-w64/7.0.0_1/toolchain-x86_64/bin/x86_64-w64-mingw32-ld: /Users/hasan/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-pc-windows-gnu/lib/crt2.o:crtexe.c:(.rdata$.refptr._onexitbegin+0x0): undefined reference to `_onexitbegin' This document outlines the process of installing Apples command line developer tools (which provide a C compiler) and Microsofts Visual Studio Code (which. Got the below error" error: linking with `/usr/local/bin/x86_64-w64-mingw32-gcc` failed: exit code: 1 Rustup run stable cargo rustc -release -target=x86_64-pc-windows-gnu -C linker=x86_64-w64-mingw32-gcc In any case, you'll have to pay Apple $99/year for Developer Program membership if you're doing this on your own time and money-it's needed to get a certificate from them. Given all this, your best option might be to use a service like Travis instead if you don't have access to a macOS environment. Right now it's possible for users to run applications that haven't been signed and notarized if they jump through some hoops, but I'm not sure even that will be possible in the future given the direction Apple seems to be going. There's a big caveat though: Apple wants all new macOS applications to be signed and notarized, and although people have figured out some ways to sign macOS apps outside of macOS I don't think the same is true for notarization since it partially happens on Apple's servers. ![]() This post suggests installing osxcross and then using Rust's x86_64-apple-darwin target. Reading about cross-compiling Rust, I get the impression that the best (currently only?) option is to use Linux⟶macOS cross compilation tools from something like the WSL or a Linux VM. It might be possible that you could run into trouble with crates that package C dependencies if their build.rs scripts aren't written well enough, but if you have some experience with cross-compiling C you could probably work out any issues like that if you care to do so.Īs far as cross-compiling for macOS on Windows, I haven't tried cross-compiling for macOS in general so I can't speak from experience, but I have done some native macOS development so I know a bit about it from that angle. COMPILAR PARA WINDOWS EN MAC INSTALLI think you would probably need to install the MinGW cross-compiler, which you can do easily with brew install mingw-w64 if you have Homebrew installed. rustup supports x86_64-pc-windows-gnu and x86_64-pc-windows-msvc targets I found using them on Linux to be as easy as rustup target add x86_64-pc-windows-gnu followed by cargo build -target=x86_64-pc-windows-gnu, and I imagine the same would be true under macOS. That said, I've found cross-compiling Rust code for Windows on Linux to be quite easy, and I imagine you can take the same approach on macOS. I haven't actually tried this (I'm on Linux) so someone else may be able to give you better advice. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |