This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc makefile hello world (iostream issue)


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]