I want to know, why is it too hard to make a program run in many OSes, like Windows and Linux, without including glue code. They all share the same architecture (x86), so I think it should be simple. Furthermore, C is standardized, so why are implementations diferent in these OSes? Why is it hard to follow the standard and implement a universal library for all OSes?
I have programmed in C for almost two years, and currently I use glib for portability.
I'm not looking for a solution to this problem, I'm already using glib for this purpose. But I want to know why it is necessary, why it's dificult to make a C library without differences.
[ADD]
For example, when i write a program in C/Glib, i use the gchar/gint and so on types indeed the C primitive types, in wikipedia about glib, it says that :
"Features
On an elementary level GLib provides type definitions replacing the C primitive types char, int, float, and so on in order to improve portability"
Why C primitive types is not portable and the whole language?
Thanks for all the answers.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…