Re:Zig cc: A drop-in replacement for GCC/Clang (2020)
by zamadatix on Sunday July 18, 2021 @12:26PM
(#27874192)
I'm not sure what's really "missed", if you call a library other than the stdlib of course you're going to need to provide the appropriate headers/libraries for that as that's got nothing to do with a C compiler.
[ Parent
| on HN ]
Re:Zig cc: A drop-in replacement for GCC/Clang (2020)
by pjmlp on Sunday July 18, 2021 @12:57PM
(#27874472)
In general, it isn't so clear when these kinds of examples are posted.
And to go back to my examples, headers and libraries alone won't make it, without the remaining toolchain to create the appropriate package.
Re:Zig cc: A drop-in replacement for GCC/Clang (2020)
by zamadatix on Sunday July 18, 2021 @01:15PM
(#27874614)
Well for your particular examples UWP is C++/C#/a few others but it has no direct c binding and iOS APIs are all defined for Objective-C and Swift so sure, you're not going to get far with a C compiler before you even start thinking about a c cross compiler.
If you want to cross compile C stuff e.g. a Win32 GUI app with Direct X or get OpenGL bindings for SDL though those all work just fine if you provide the SDK files same as you would compiling natively. The advantage being now you can do all builds from a single build instance just by feeding it the libraries and a target platform.