How do I cross-compile C code on Windows for a binary to also be run on Unix (Solaris/HPUX/Linux)?

后端 未结 7 1957
我在风中等你
我在风中等你 2020-12-10 19:12

I been looking into Cygwin/Mingw/lcc and I liked to be able to compile perl native C extensions on my windows(preferably under cygwin) and then run them on Solaris and HP un

7条回答
  •  失恋的感觉
    2020-12-10 19:41

    Cross-compiler are very hard to setup and get working correctly.

    Consider that (the people at) NetBSD have to put in a huge amount of work to get cross-compiling to work, and they're running the same OS, just different architectures.

    You'd have to, at least, copy all the headers from the other OSs to Windows, and get a cross-compiler, linker etc for the target OS/architecture.

    Also that may well not be possible - perl and shared libraries may be compiled with a native/non-gcc compiler which won't be available on Windows at all.

提交回复
热议问题