Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Linux and/or C++ on OS X?

Linux and/or C++ on OS X?
Thread Tools
mtbiac
Fresh-Faced Recruit
Join Date: May 2004
Location: Florida
Status: Offline
Reply With Quote
May 30, 2004, 03:42 PM
 
I just got a 12" iBook (first mac ever) and I'm loving it!! I'm running 10.2.8. Only thing I'm "missing" is the ability to play with linux distros and more importantly C++ programming. Is it possible to get either of these working (somewhat well) in OS X? I dont really want to use an emulator type program to do this either. I'm just learning to program c++ so if OS X doesnt necessarily have all of the features I'd have in windows, thats cool...

thanks for the advice.
     
mitchell_pgh
Posting Junkie
Join Date: Feb 2000
Location: Washington, DC
Status: Offline
Reply With Quote
May 30, 2004, 04:03 PM
 
If you want to program for Linux, you should probably pick up a PC and run Linux.

If you want to program for Windows only, you should pick up a copy of Windows.

If you want to learn C++ on a Mac...
check this out

http://forums.devarticles.com/showth...1902#post31902
     
mitchell_pgh
Posting Junkie
Join Date: Feb 2000
Location: Washington, DC
Status: Offline
Reply With Quote
May 30, 2004, 04:05 PM
 
P.S. I wasn't trying to be rude, I'm just waiting for the anti-mac comments (considering it was your first post)
     
Developer
Addicted to MacNN
Join Date: Apr 2001
Location: europe
Status: Offline
Reply With Quote
May 30, 2004, 04:05 PM
 
Linux in OS X? I don't think that's possible, but you can install Linux on a separate partition.

C++. You need to install the Developer tools. They came on a separate CD with the OS.
Nasrudin sat on a river bank when someone shouted to him from the opposite side: "Hey! how do I get across?" "You are across!" Nasrudin shouted back.
     
Drakino
Grizzled Veteran
Join Date: Apr 2001
Status: Offline
Reply With Quote
May 30, 2004, 04:46 PM
 
While you can run Linux inside Windows on a PC at this point, the same tech hasn't been moved to the PPC platform yet.

However, you can run Linux directly on your system, then boot OS X inside Linux wuth MacOnLinux. Not sure how well it runs, I've only used OS X on my two Macs.
<This space under renovation>
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
May 30, 2004, 05:36 PM
 
The most Mac-friendly Linux distro is Yellow Dog Linux. As others have said, this doesn't run "on Mac OS X", it runs natively as an alternative operating system.

For C++, you need the Xcode Tools. These may be located in /Applications/Installers on your new computer (the separate CD only exists for the retail boxed edition of Mac OS X). Anyway, I doubt you'll have the latest version, which can be downloaded from the ADC Member Site (free registration required). While you're at it, check out the main Apple Developer Connection site and the Developer Center forum.
     
Keiretsu
Dedicated MacNNer
Join Date: Sep 2003
Status: Offline
Reply With Quote
May 30, 2004, 05:46 PM
 
Originally posted by mtbiac:
I just got a 12" iBook (first mac ever) and I'm loving it!! I'm running 10.2.8. Only thing I'm "missing" is the ability to play with linux distros and more importantly C++ programming. Is it possible to get either of these working (somewhat well) in OS X? I dont really want to use an emulator type program to do this either. I'm just learning to program c++ so if OS X doesnt necessarily have all of the features I'd have in windows, thats cool...

thanks for the advice.
Fink allows you to install most of the software that makes up GNU/Linux systems. You can install these packages either from source (i. e. compile them yourself) or install pre-compiled binary packages.

Get your developer tools (most prominently the gcc compiler) from Apple's Developer site. After free registration for online membership you can download all of Apple's developer tools.
     
geran
Forum Regular
Join Date: Feb 2001
Status: Offline
Reply With Quote
May 31, 2004, 07:41 AM
 
If you want to learn c/c++ programing it does not mather if you use OSX or Linux, its almost the same if you only write console based apps. Ansi C is the same on both plattforms, they both use gcc (the compiler) I good start is to buy a book on C, if you later wish a more advanced book you can buy W. Richard Stevens book "Advanced Programing in the Unix Enviroment", the second edition is the latest.

Just make sure you have the dev tools installed.

I belive that OSX is a exelent plattformn for developing, nice GUI, kickass commercial apps like photoshop, illustator ... and the unix side of the OS.

Its been mention before, fink allows you install a massive amount of opensource apps.

If you want to play around w. Linux, just do so, make a extra partionen on your hardrive and install a Linux distro on that and dual boot.
     
mtbiac  (op)
Fresh-Faced Recruit
Join Date: May 2004
Location: Florida
Status: Offline
Reply With Quote
May 31, 2004, 11:47 PM
 
OK so I installed the developer tools and got the C++ going

About the linux - i meant was it possible to install linux on a separate, non-mac partition. I've never heard of Yellow dog, but would it be possible to install red hat or mandrake on a separate partition? Woudl it work well enough to use somewhat often to play around in??

thanks
     
bzImage
Junior Member
Join Date: Mar 2003
Status: Offline
Reply With Quote
May 31, 2004, 11:55 PM
 
Originally posted by mtbiac:
OK so I installed the developer tools and got the C++ going

About the linux - i meant was it possible to install linux on a separate, non-mac partition. I've never heard of Yellow dog, but would it be possible to install red hat or mandrake on a separate partition? Woudl it work well enough to use somewhat often to play around in??

thanks
AFAIK RedHat nor Mandrake packs versions for ppc.

I use gentoo and im happy with it.
     
wataru
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status: Offline
Reply With Quote
Jun 1, 2004, 12:08 AM
 
Yellow Dog is a Red Hat derivative, I think. I have it on a beige G3. I don't know much about the various distros, but YDL is pretty nice.

The only caveat is that you have to repartition your hard drive, and there are no easy ways to do that non-destructively.
     
bzImage
Junior Member
Join Date: Mar 2003
Status: Offline
Reply With Quote
Jun 1, 2004, 12:16 AM
 
Originally posted by wataru:
Yellow Dog is a Red Hat derivative, I think. I have it on a beige G3. I don't know much about the various distros, but YDL is pretty nice.

The only caveat is that you have to repartition your hard drive, and there are no easy ways to do that non-destructively.
The new version of "parted" (linux partition utility) can repartition HFS+ non destructively. (is included on the gentoo live cd)

And there its some new OS X application that can do that also, i dont recall the name it was on the cover of macnn some days ago.
     
wataru
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status: Offline
Reply With Quote
Jun 1, 2004, 12:21 AM
 
Originally posted by bzImage:
The new version of "parted" (linux partition utility) can repartition HFS+ non destructively. (is included on the gentoo live cd)

And there its some new OS X application that can do that also, i dont recall the name it was on the cover of macnn some days ago.
That's news to me. Thanks for the heads up.
     
Brass
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Jun 1, 2004, 01:09 AM
 
Depending on what you want Linux for, keep in mind that Mac OS X is based on Unix, and Linux is essentially a copy of Unix, and most things that you can do in Linux, you can do in Mac OS X.

The unix foundation of Mac OS X is a BSD based OS called "Darwin". I'm not sure what you want from Linus, but you may find Darwin already does what you want, and it's already part of Mac OS X.
     
Gavin
Mac Elite
Join Date: Oct 2000
Location: Seattle
Status: Offline
Reply With Quote
Jun 1, 2004, 06:29 AM
 
Originally posted by bzImage:
AFAIK RedHat nor Mandrake packs versions for ppc.
Actually Mandrake does have a ppc version:
http://www.mandrakelinux.com/en/ftp.php3

Linux is alive and well on PPC with several distributions. Check out this page:
http://penguinppc.org/
     
Kristoff
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Jun 1, 2004, 10:50 AM
 
besides the PPC distros, can't he run anything inside VPC?

BTW: I used SuSE for 6 months when I bought my pismo prior to the release of OS X Public Beta.
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
Phanguye
Mac Elite
Join Date: Oct 2001
Location: Umbrella Research Center
Status: Offline
Reply With Quote
Jun 1, 2004, 10:53 AM
 
i have heard good things about the gentoo ppc distro
     
Chris O'Brien
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
Jun 1, 2004, 11:05 AM
 
Yeah - I've been using mandrake 9.1 for ages on my B&W PowerMac G3 (nearly a year I think...). However, I haven't booted into it for about a month - I installed KDE and Gnome via fink and have never bothered with Linux since. There's a few dependency problems and a few things you need to change (because of the different directory structures), but I'm as happy as can be

Although - I've still got an old x86 box lying around with a copy of slackware on it, just to keep my hand in (so I can still have OS X on at all times...)
Just who are Britain? What do they? Who is them? And why?

Formerly Black Book
     
Millennium
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Jun 1, 2004, 11:13 AM
 
As long as you restrict yourself to console-based apps (and if you're just starting out, then I recommend that you do this; you can move on to GUI programming once you've mastered the basics), then I wouldn't worry too much. OSX and Linux are almost identical in this regard, and programs written for one -C++ or otherwise- will usually work on the other. You'll need to recompile your app on each platform, but you shouldn't need to change the code.

Once you move into GUI stuff, though, you'll need a Linux installation. If you use a cross-platform toolkit such as wxWidgets (nee wxWindows), then programming between the systems still has many similarities, but they no longer merit "almost identical" status.

As Mitchell mentioned, I would install Yellow Dog Linux and dual-boot; that's the easiest way to get up and running with multiple systems.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Chris O'Brien
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
Jun 1, 2004, 12:02 PM
 
Originally posted by Millennium:
As long as you restrict yourself to console-based apps (and if you're just starting out, then I recommend that you do this; you can move on to GUI programming once you've mastered the basics), then I wouldn't worry too much. OSX and Linux are almost identical in this regard, and programs written for one -C++ or otherwise- will usually work on the other. You'll need to recompile your app on each platform, but you shouldn't need to change the code.

Once you move into GUI stuff, though, you'll need a Linux installation. If you use a cross-platform toolkit such as wxWidgets (nee wxWindows), then programming between the systems still has many similarities, but they no longer merit "almost identical" status.
Having KDE and Gnome installed with Apples X11 has meant (for me) that I've been able to run basically anything I've found for Linux. I admit I haven't gone out of my way to test this, but there doesn't seem a lot that I'd want that I haven't got... As long as the program you want is in fink, it seems to be fine - and if you're just getting into linux, then the majority of what you want will be there.
Just who are Britain? What do they? Who is them? And why?

Formerly Black Book
     
Kristoff
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Jun 1, 2004, 12:05 PM
 
you don't even need FINK.

just download the source tarball of the app you want

./configure
make
make install


you might have to make some changes to fix compile issues, but I have successfully compiled nmap and ethereal from source with no changes.
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
Chris O'Brien
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
Jun 1, 2004, 12:22 PM
 
Originally posted by Kristoff:
you don't even need FINK.

just download the source tarball of the app you want

./configure
make
make install


you might have to make some changes to fix compile issues, but I have successfully compiled nmap and ethereal from source with no changes.
yeah, mentioning fink was me being nice to people just starting out. Plus, getting the binaries from it can be nice and quick

Have you tried ettercap? That took me a wee while to compile and install... Saying that, I prefer ethereal. I've never compiled nmap, because it just reminds me of one of the haxxxor videos, and I can't take it seriously anymore

Anyhoo - It seems like I spend my whole life typing ./configure make sudo make install/test
Just who are Britain? What do they? Who is them? And why?

Formerly Black Book
     
Sven G
Professional Poster
Join Date: Dec 2000
Location: Milan, Europe
Status: Offline
Reply With Quote
Jun 1, 2004, 01:10 PM
 
Originally posted by Black Book:
Yeah - I've been using mandrake 9.1 for ages on my B&W PowerMac G3 (nearly a year I think...).
I tried to install Mandrake 9.1 (still no 10.0 for PPC) some months ago, but wasn't able to get the video working: there are some big problems with the Radeon graphics cards, AFAIK - so, no luck with my G4 and Radeon 9000, sofar.

Sadly, x86 Linux in Virtual PC is too slow and sluggish to be really usable (and no VPC Additions, also): otherwise, it could be a good solution. Anyway, this option won't probably be developed anymore, with Microsoft now owning VPC...

The freedom of all is essential to my freedom. - Mikhail Bakunin
     
Chris O'Brien
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
Jun 1, 2004, 01:40 PM
 
Originally posted by Sven G:
I tried to install Mandrake 9.1 (still no 10.0 for PPC) some months ago, but wasn't able to get the video working: there are some big problems with the Radeon graphics cards, AFAIK - so, no luck with my G4 and Radeon 9000, sofar.

Sadly, x86 Linux in Virtual PC is too slow and sluggish to be really usable (and no VPC Additions, also): otherwise, it could be a good solution. Anyway, this option won't probably be developed anymore, with Microsoft now owning VPC...
I've only got a piddly ATI Rage 128 that doesn't even support quartz extreme

Mandrake 10 will be out for PPC soon enough, so hopefully it'll work with your card then...
Just who are Britain? What do they? Who is them? And why?

Formerly Black Book
     
Phoenix1701
Senior User
Join Date: Jun 2001
Location: Massachusetts, USA
Status: Offline
Reply With Quote
Jun 1, 2004, 02:46 PM
 
My suggestion to someone wanting to play around with Linuxy stuff would be to do the following.

Download and install Apple X11 (if you haven't already) from http://www.apple.com/macosx/features/x11/
Download and install fink from http://fink.sourceforge.org/
Set up fink (don't forget to add "source /sw/bin/init.sh" to your .tcshrc or .bash_profile or something).
Using fink, install KDE or Gnome or your window manager of choice (sudo apt-get install bundle-kde or sudo apt-get install bundle-gnome, respectively).
Go into X11 preferences and set X11 to use full-screen mode.
Add "/sw/bin/startkde &" or something similar to your .xinitrc file so X11's default Aqua window manager doesn't start.
Run X11, log into KDE or Gnome, and enjoy the Linuxy experience. You will actually just be running X11 on top of Darwin, but Darwin is a BSD variant anyway, so the difference will be nearly unnoticeable.
     
h00ligan
Forum Regular
Join Date: Jul 2003
Status: Offline
Reply With Quote
Jun 3, 2004, 12:45 AM
 
just throwing in that debian has a ppc branch too don't they?
-= H00ligan =-

1.33 GHz 12" | 60 gig 7200 rpm drive | 1.25 Gigs of ram
amd 64 3000+ eMachines m6805 (arima lappy) | 60 gig | 512 megs | almost 3400 3dMark03 and it was only $1250 :)
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 3, 2004, 06:42 AM
 
Originally posted by h00ligan:
just throwing in that debian has a ppc branch too don't they?
Probably not the best idea for newbies, though

Seriously, YDL has the best Mac support (they're a purely PowerPC distribution, they're partners with Apple - in fact they're the only people allowed to sell Macs with a different OS pre-installed IIRC).
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 3, 2004, 06:45 AM
 
Originally posted by Millennium:
Once you move into GUI stuff, though, you'll need a Linux installation. If you use a cross-platform toolkit such as wxWidgets (nee wxWindows), then programming between the systems still has many similarities, but they no longer merit "almost identical" status.
But, uh, all the popular Linux toolkits run just fine on OS X in X11. (GTK runs in X11, Qt runs both in X11 and natively).
     
ryju
Professional Poster
Join Date: Aug 2002
Status: Offline
Reply With Quote
Jun 3, 2004, 07:55 AM
 
I managed to install Mandrake 9.1 on my iMac and the video worked fine, however the keyboard layout was somehow entirely random and I had no idea how to type in my user password so couldn't log in. To fix this I installed it without a password protected user (I think?) and changed the keyboard layout when logged in.

You could always use VPC for redhat, that's what I did, however it was slow.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 01:51 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,