AeroZeppelin Posted May 14, 2008 Share Posted May 14, 2008 I've decided during my summer break to start learning how to program. I want to use my MBP to learn C/C++ (I know that most of you will disagree on the starting language and I may switch to Java.) However, Xcode is pretty daunting and I haven't figured out how to compile and work the program in my favor. Learning the code hasn't been the issue its trying to take tutorials and books written for either linux or windows and convert that knowledge to Mac. I've been googling for days on how to work xcode and compile. Can anyone suggest any sites or strategies on learning the program so I can start programming :) What I have done: read the Apple Developers site Googled for tutorials skimmed online manual. P.S. I thought this question was too newbish for the likes of the programming coding sub-forum. Feel free to move it if i was wrong. Quote Link to comment Share on other sites More sharing options...
Rab Posted May 14, 2008 Share Posted May 14, 2008 I did some java programming on a mac at uni, it pissed me off muchly. That being said, it shouldn't be a showstopper. I started learning using: ISBN-10: 0201711079 / Understanding Java / Barry Cornelius I'm mostly writing Windows Services these days using Visual Studio in C# and that's what I find most enjoyable compared to all the other crap languages i've tried. VB can suck my fat one. Back to the matter at hand. If you don't like Xcode, don't use it. You should be able to get by just fine without it. Just Googled Xcode, looks like a total bag of shit. Defo work around it. The best would probably be to download a nice, free text editor, like TextWrangler. Write your code in that and compile and run via Terminal... Make a file with the code, name it file.c. Open Terminal use cd to get to the directory (folder) where the file is. Compile with gcc -o program file.c And run it with ./program Of course you can use other names for your file and executable... Quote Link to comment Share on other sites More sharing options...
sablefoxx Posted May 14, 2008 Share Posted May 14, 2008 What Operating System are you in/want to code for? Windows: If you're in Windows I'd say grab Dev C++ IDE here (uses GCC) >> Download Here No install needed on that version, to compile just select Build > 'Compile' (you'll want the run the .exe from the command line) Linux (my person favourite): If you're in Ubuntu Linux you'll want the build essential pack, in your terminal type: sudo apt-get install build-essential To write code you can use gedit/any text editor, then to compile use these commands (in the terminal): (you will need to be in the same dir as the saved source code (.c/.cpp) g++ -Wall ./example.cpp and to run it use: ./a.out Never Coded in OSx. If you have questions, or problems comiling/writing feel free to post them here or in the coding section of the forums :D Quote Link to comment Share on other sites More sharing options...
nicatronTg Posted May 15, 2008 Share Posted May 15, 2008 If MacOS is just BSD with a fancy skin, shouldn't you be able to build a BSD script and run it on a mac. Like the script to build what ever is in a folder? If not, you could always try a third party c++ compiler. Quote Link to comment Share on other sites More sharing options...
snakey Posted May 15, 2008 Share Posted May 15, 2008 i want to use my mbp you want to use your man bear pig? Quote Link to comment Share on other sites More sharing options...
Rab Posted May 15, 2008 Share Posted May 15, 2008 ho ho ho Quote Link to comment Share on other sites More sharing options...
geekdba Posted May 17, 2008 Share Posted May 17, 2008 I installed xcode onto my mbp but I just use the terminal (vi to write the code) and use gcc or g++ to compile, so far while learning the language it has not been bad, I am using the book The C programming language by Brian W kernighan & Dennis M Ritchie Hope this helps Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.