Friday 27 March 2015

Compiling C/C++ with Eclipse in Mac OSX 10.10

1. Install a VMWare Player and build a MAC OSX 10.10 as the following link:
https://www.youtube.com/watch?v=G-r8CvCnen4

2. Download Eclipse CDT for MacOS 64 bits

3. Download Oracle JDK 7 for MacOS 64 bit. Install Java

4. Install Xcode from Apple Store (maybe not necessary because we will use different GCC version)

5. Install Macports. This tool is useful to install the other tools

6. Install GCC4.9 (the current latest version):
$ sudo port selfupdate
$ sudo port install gcc49
$ sudo port select --set gcc mp-gcc49
(reference: http://www.ficksworkshop.com/blog/14-coding/65-installing-gcc-on-mac)

7. To compile a C++ project from OSX 10.10 that can run for lower OSX version we need:

7.1  add option for compiler such as: -mmacosx-version-min=10.5
7.2 add standard library in linker such as: -stdlib = libstdc++




8. Now we can build the project.

No comments:

Post a Comment