Compiling Linux software under Windows - your advice?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Compiling Linux software under Windows - your advice?
I am a bit new to Linux but I have Windows programming experience. Recently I found LinuxFromScratch project and it really attracts me. But I have some problem: at home I have a Celeron 700 PC which is a bit slow for compiling some bigger packages and I am still using Linux only in VMWare Workstation - do not want to risk and lose my data during my first Linux experiments. I have access to my friend's 2.0 GHz PC where I can get to the Internet and do other stuff. I do not want to affect friend's hard disk drive so I cannot install Linux there. But I can install some programs which could do compiling.
I have heard a bit about DJGPP, DevC++, MingW and CygWin, but google gave very poor results for my question searches. So maybe there is someone who could suggest something useful - is it really possible, which compiler to choose, what problems can prevent me from doing this? Any useful links would be appreciated.
Problems? Sorry, I don't really understand what you're saying. Personally, I think the best solution for you would be to get yourself a live Linux distro and start off with basic commands on that. Then, once you've mastered trivial things like cp, mv, rm, ln, etc... and a few of their useful options, you could move a step closer to your goal.
I've heard quite a lot about CoLinux, and also about Cygwin. Haven't had time to Google for CoLinux help, but from what I remember the installer was pretty straight forward. I managed to find An Introduction to Cygwin, which you may find useful.
I would not advise going for LFS if you've had little prior experience with Linux - I've been using Linux for over a year and I still don't dare try LFS. It's up to you though - if you'd like to take the jump and get into a _deep_ mess, there's no-one stopping you! Hehe! Maybe a distro with a steep learning curve like Gentoo or Slackware would suit you better. I dunno, go wherever your heart desires.
Cygwin and MingW are great, if you're a masochist. I actually haven't used Cygwin that much and haven't used MingW at all, but I'm always coming across posts/emails from people who can't get things to work under those platforms. Most open source programmers only support them as an afterthought, if at all, so programs tend to break under those platforms (probably they're OK if you use only the most popular packages, because somebody will have probably fixed the bugs already). Try Knoppix or some other Live CD instead.
And hard drives are cheap these days. They're practically giving away smallish ones, and a 5 gigger salvaged from some 1997-era piece of crap would be plenty big enough to play with Linux. That way you could put it in a machine, install Linux on it, and not worry about screwing up somebody elses disk.
Thanks for ideas. Still it would be nice to hear from somebody who has succeeded in compiling for Linux under Windows. Hmm.. maybe there are no such people at all ? Anyway I'll try DJGPP, let's see what I get.
If I understand you right, you want to compile Linux binaries on a Windows machine? And you want to do that for a full Linux distribution? Why not just grab a distro like Slackware that has all the stuff you will need pre-compiled? You'll save yourself a lot of headaches.
Isn't DJGPP an old DOS compiler? I don't think it can create Linux binaries for you. And Cygwin basically gives you a Linux environment on a Windows OS. It comes with the GNU compilers and stuff, but when you compile with it, they will be Windows binaries, not Linux binaries.
What you need to create binaries for a particular target platform on a different platform is called a cross-compiler. I THINK I've heard that MingW has a cross compiler, but I haven't really messed with it. I usually just compile my Linux binaries in Linux, and Windows binaries in Windows, so I haven't had much need for a cross-compiler.
Sorry but I have to agree. cygwin was ok to install and play with but at the end of the day, I installed Mandriva and never looked back. I am the same, I develop on Win and *nix. I code in ansi c so I can pretty much port the c and h files from the two pcs and I am fine. Do note that cygwin does have some issues, not all of the libs work 100% as they should. The thing that made me go to linux in the end was the fact that cygwin doesnt handle some of the multi threading commands on pthreads.
Anyway, make the change and unless you play games alot, you will never look back