Cross-platform C program

Asked

Viewed 132 times

1

If I make a program in C and don’t use any Windows library leaving the program totally pure in C I can compile it for Linux as well?

and will function normally?

1 answer

1

Yes, if you use the ANSI C standard, or compatible libraries, then you can compile for windows and linux.

  • Graphic libraries of C exist by ANSI standard?

  • There is the Qt which can be build for many platforms take a look at it. GTK also.

  • I don’t know if Qt is cross-pilot, i believe that the source should be compiled on the target platform.

  • Yes, so far so good. No need to make drastic changes to the code (no reprogramming twice for each platform)

  • 2

    Qt is C++, it is practically impossible to use with C, although technically there is how, with a lot of work, will get pork. GTK for Windows at risk. Some things are very specific and no library can abstract. Qt even gets good results across platforms, other libraries get mixed results.

  • Good observation @bigown.

  • In fact even in Java itself there is no such compatibility of environments, I am in a desktop project, I was developing on linux, and most clients were Window and time by time other event related bugs appeared.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.