News for hackers. Stuff that matters.
Re:A Simple Makefile for Medium-Sized C/C++ Projects by 72deluxe on Friday August 26, 2016 @11:29AM (#12366917)
Why not just use Xcode and xcodebuild from the CLI if you don't like the IDE?

I write all my OSX projects in C++ using it.

Learning to build projects and solve compiler and linker errors is part of the journey. Stroustrup's book takes longer to read than 5 minutes, so writing C++ will take longer. It is a rewarding journey, where you will suddenly find all other languages (Java, C#, C, JavaScript, Swift) very similar or simplified in comparison.

To get you started you could install xcode and the commandline tools, write your file.cpp and use:

g++ -o myprogram file.cpp

This assumes no linker options, no preprocessor options or anything, and on OSX will use clang, which it secretly symbolic links as g++. You might find it easier to get your head around it by starting a project in Xcode, setting the options in the IDE and then observing the output that it runs.

Note that installing a library on most Unix platforms isn't complicated - configure, make, make install.

There are no comments on this comment yet.