gcc makefile hello world (iostream issue)

Jonathan Wakely jwakely.gcc@gmail.com
Wed Jun 20 22:37:00 GMT 2012


On 20 June 2012 23:04, blessman11 wrote:
>
> hi
>
> I'm trying to code hello world in GCC, but whilst I get my simple makefile
> correctly, the problem comes when I try to use <iostream> or even my own
> headerfiles defined outside the folder with my main .cpp file.
>
> so any help?

This question would be more appropriate on the gcc-help mailing list.

> How should I alter the makefile below to accommodate <iostream> or any
> header files out side my main.cpp file folder?
> [output]all: hello
>        -std=c++11
>
> objects = hello.o
>
> edit: $(objects)
>        cc -o edit $(objects)

cc is the C compiler, use g++ to compile C++

To find headers in other directories use the -I option.



More information about the Libstdc++ mailing list