Posted: . At: 10:50 AM. This was 6 years ago. Post ID: 11660
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Useful tips for a programmer on a Macintosh machine. Install GCC.


How to install the GCC compiler for Macintosh programming on a Macintosh Air.

This simple command will install the GCC compiler collection and the make command on a Macintosh. This enables programming console apps on a Macintosh machine. These instructions are for Macintosh OSX Sierra. May not be the same on an older Macintosh machine. But give it a try anyway. Either this or the Software Center.

Johns-MacBook-Air:Documents jason$ sudo xcode-select --install

Then write a simple c program.

#include <stdio.h>
#include <stdlib.h>
 
#define hi "Mr Anderson"
 
int main(void) {
	printf("Hello %s\n\n",hi);
	return 0;
}

And then compile it with GCC.

Johns-MacBook-Air:Documents jason$ gcc intro.c -Wall -o intro

And we are programming on a Macintosh in no time.

Johns-MacBook-Air:Documents jason$ ./intro 
Hello Mr Anderson

This is how easy it is to install the GCC compiler collection on a Mac.

To get a nice VIM programming environment, use this .vimrc file I created. This will make the code colorful and make the editor more fun to use.

http://securitronlinux.com/uncategorized/my-nice-vimrc-file/.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.