how to make a c++ program and compile it on macbook pro
how to make a c++ program and compile it on macbook pro
i have no idea how to do it i am a new user
MacBook Pro with Retina display, OS X Yosemite (10.10.2), null
how to make a c++ program and compile it on macbook pro
i have no idea how to do it i am a new user
MacBook Pro with Retina display, OS X Yosemite (10.10.2), null
First You Open a Terminal window and at the prompt type g++ ( $> g++ ) press Enter if it is Not install it will tell
you that you need some developer tools and tell you how to install them.. If it Is Install it will say something like
No Filename given.
to compile C++ Program:
1.> Write you C++ Program ( ie. Some.cpp )
2.> at the Prompt $:> g++ ./Some.cpp -o ./MyProg -or- $:>g++ ./Some.cpp
NOTE:
$:> g++ ./Some.cpp -o ./MyProg ---> Makes a Executable file Named MyProg
You can use any filename you want to, I Use MyProg for this example.
$:> g++ ./Some.cpp ---> Make a standard Executable called --> a.out
If you need a more secure error correct version of an Executable (ie. No warning error.)
Then use the -Wall Option: $:>g++ -Wall ./Some.cpp -o ./MyProg
PS:
You can use VI or any other Unix Command Line Text Editor to Write your C++.cpp File.
like: vi, vim, elvis, ed, pico, nano, mcedit, joe, jed, emacs ... Or Whatever you want, But
it has to be a straight Text Editor.!! *** No Word Processors.!! *** like: word or works or
Anything with different Fonts or layouts.!! Write All your Programs in Just plain Text Editors.
I Hope That This Has Helped You.. Good Luck and God bless you:
But Most of all Have Fun Programming..
*^*(:)<[?]>(:)*^*
Michael L. Estes
(31337 - #!/bin )
## [End of File.]
I'm not so sure that is possible. Xcode which can be downloaded for free from the App Store, allows you to program in Objective C or Swift. I thought I read that visual studio (Microsoft's) development package is now available on OS X but I'm not sure. You are going to need to look for something that will run on OS X. Does it have to be c++? Objective C is similar but object oriented.
You might also want to look into Parallels (virtual machine software) this will allow you to run windows or another distribution of linux as a virtual machine and then you would have more IDEs to choose from.
Make certain that your Mac is running OS X 10.10.5, not the 10.10.2 that you show in your signature. Sign up for a free Apple Developer account and not the paid version at this time. Once you are signed up for that free developer account, you will want to download/install the latest (non-beta) Command Line Tools (OS X 10.10) for Xcode 6.3.2. This gives you command line compilation tools (C/C++/Objective-C), their libraries, and include files for development in the Terminal. It does not include Xcode 6.3.2 — which you don't need initially for learning to make and compile a C++ program. Apple does not provide the GNU compiler technology, and instead, implements them more efficient, modern Clang/LLVM solution.
Here is a typical Clang C++ compilation syntax that does not use any of the C++ 11 extensions:
clang++ -Wall -O2 -o fib_memo fib_memo.C -stdlib=libc++
You need to install the Mac Developer Tools either from your original Mac OS X disk or by downloading the latest version. This package includes the GCC compiler collection (supporting the C and C++ languages, amongst others).

The OP is on Yosemite, not Snow Leopard. The Xcode interface has changed substantially from your posted images.
I appreciate the question because I had the same question! I know Stack Overflow hates these questions but I've never coded C++ on my Macbook.
You need to install the Mac Developer Tools either from your original Mac OS X disk or by downloading the latest version. This package includes the GCC compiler collection (supporting the C and C++ languages, amongst others).
Basically you should get a (free) developer account and then download Xcode.
Unfortunately, starting with Xcode 4, Apple is charging 5$ for the download. So you could either decide to pay this, or download the previous version (Xcode 3)The main page for Xcode is this. There you will find links to Xcode 4 and Xcode 3 (search within the page)
Follow the instructions carefully.
This tutorial is to help out anyone that wants to create a terminal based c++ program using Xcode for Mac OS X and for the persons who are into Java training in chennai. This is mainly for the people in CS 150 at ODU, but I think many can benefit from this as a getting started guide. If you know some basic C++ already this guide will be easier to you, but no prior knowledge is required for this how-to.
Make SURE you convert to plain text in TextEdit when writing code. Compilers and rich text format don't get along.
You'll need a C++ compiler, obviously - and it needs to be in your PATH environment variable to be usable in the Terminal. If you use Xcode's command line tools, this part is done for you.
Compiling and running is really easy:
...where the compiler_name and options depend on your compiler.
For Xcode, either GCC or Clang will work.
Are your projects 10s,100s,1000s,10000s,etc. lines of code? I've worked on professional projects with millions of lines of code, and we used vi/vim to edit and make/rake to build. My point is that you're complaining that the tools youve found aren't just perfect for you to ply your trade. I encourage you to stop that sort of thinking. It will serve you well to be comfortable with a wide range of tools, so you can be effective in lots of environments.
You've stated Eclipse is too complex and a text editor and gcc is too simple. You're basically saying: without Borland I'm not comfortable programming. I would insist you work through that discomfort and come out the other side a more versatile programmer. If you don't want anything different, you can get a Windows VM and install Borland. You'd be robbing yourself of an opportunity to learn and grow if you do, though.(hadoop training in chennai)
Code more, search for a Borland-alike less. Good luck.
-Lee
P.S. unless you invent a language and code in it for years, don't say you're advanced. It's a death sentence, and makes the offer to others to attack your understanding.
Thanks for the reply jhon, the discussion you have created was very useful though.
Elixir of immortality | Is immortality possible | What are dreams
how to make a c++ program and compile it on macbook pro