So I'm totally new to the mac community (got my macbook pro for xmas) and now the semester has started again and Im registered in a first year math course -- introduction to computing with c++. Now you guys can probably see where this is going. Basically, I hadone class and my professor gave us a linkto download a c++ compiler for windows, and I emailed him asking about one for Mac, and he told me I would have to search the internet for one as he has no experience with mac. So i did some searching and determined i should download xcode? NOW im still downloading it, but im fairly certain i wont be able to work it. Im not a computer programming person, im only taking this course to satisfy my math credit requirements, but i do think it is something i may enjoy once i learn it. Im really confused, and my prof wrote the textbook we use himself so i dont really find it to be much help. Honestly, any help would be greatly appreciated. To those saying don't use xcode do it all through terminal. Sure that makes sense as a step for someone trying to get into computer science, or programming as a future career. Mac address of laptop. But if all you're trying to do is pass a class then I wouldn't bother with the terminal. In xcode it is as simple as starting a new project (first prompt when it starts up). Tell it you want to make a mac OSX command line application (in this case) Then paste the code from your book into the text window. And click the button with a 'play' icon on it (build and run). May 21, 2017 - How to compile from sources GCC 8 on macOS Mojave. The instructions from this tutorial were tested with Xcode 10 and Mojave (macOS 10.14). At the time of this writing Apple's Command Line Tools maps the gcc and g++ to clang. Next, we can download and extract the latest stable version of GCC. Your results will be at the bottom in the console window. Will take you all of 5 minutes to get going. This way you won't fall behind with your class. Here is a video for Xcode 3. The interface is slightly different, but you should be able to follow along. Edit: Xcode 4 video. To those saying don't use xcode do it all through terminal. Sure that makes sense as a step for someone trying to get into computer science, or programming as a future career. But if all you're trying to do is pass a class then I wouldn't bother with the terminal. In xcode it is as simple as starting a new project (first prompt when it starts up). Tell it you want to make a mac OSX command line application (in this case) Then paste the code from your book into the text window. And click the button with a 'play' icon on it (build and run). Your results will be at the bottom in the console window. Will take you all of 5 minutes to get going. This way you won't fall behind with your class. Here is a video for Xcode 3. The interface is slightly different, but you should be able to follow along. Edit: Xcode 4 video. Everyone seems to have dropped out for dinner so I guest I'll give it a go. Assuming you run the Xcode installer. Locate and run the 'TextEdit.app' in the 'Applications' folder. Paste your code from above into the blank window and save it to whatever folder you plan to keep your Math programming projects with a name that ends with.cpp. Something along the lines of 'MathAssignment1.cpp' Now run (launch) 'Terminal.app' located in Applications/Utilities. The Terminal is analogous to the Windows command-line. You'll now need to tell the command-line where your 'MathAssignment1.cpp' is with the 'cd' (change directory) command. If you saved the 'MathAssignment1.cpp' to your 'Desktop' that would be - cd ~/Desktop Now type - clang++ -Wall -o MathAssignment1 MathAssignment1.cpp Assuming no errors you can run the executable with -./MathAssignment1 Have fun!
0 Comments
Leave a Reply. |