By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,377 Members | 3,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,377 IT Pros & Developers. It's quick & easy.

Compile linux program under windows.

P: 5

Opening eclipse from windows operating system is it possible to create a project in c language and compile the program for linux and not for windows?If possible, can someone give me some guidance?

I didn't find the right solution from the internet.
Feb 24 '18 #1
Share this Question
Share on Google+
2 Replies

P: 1
It is better to download a set of tools for compiling Linux programs by MinGW

IT support
Feb 24 '18 #2

Expert Mod 5K+
P: 9,197
The short answer is no. Windows isn't Linux.

The longer answer is yes but you will need to "wrap" system libraries in such a way that when you build on Linux you use Linux libraries and when you build on Windows you use Windows libraries and your code uses neither but calls the library wrapper function you invented.

These things have already been done. Just select a library to use, pay money and off you go.

Read up on how to cross-compile.
Feb 24 '18 #3

Post your reply

Sign in to post your reply or Sign up for a free account.