Re: gcc makefile hello world (linking iostream)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/21/2012 05:14 PM, 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?

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)

$(objects) : hello.h
hello.o : hello.h

.PHONY : clean
clean :
         -rm edit $(objects)[/output]


iostream and .cpp look like C++ to me, but you are trying to use C compiler. You need to use g++ or c++ instead of cc in the edit ...

I don't know if something is wrong with my client or mailing list, but how is it possible to automatically set reply address to gcc-help address instead of sender one?


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux