I'm having a bit of trouble making a makefile. So I was wondering if someone can point out what I'm doing wrong...
This happens when I try to compile on my school server... It works fine in visual studio
I'm getting this error:
1 2 3 4 5 6
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/array:35,
from main.cpp:11:
gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/c++0x_warning.h:31:2: error:
#error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x.
This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
Heh, I didn't look closely enough at your makefile.
There are a number of errors you are making. But I have to ask, specifically, are you trying to build three distinct programs with a single makefile? (Don't do that!)
Undaunted, here's a fairly simple makefile to help out, using implicit rules.
% gmake average
g++ -std=c++0x -g -Wall -pedantic average.cpp -o average
% gmake
g++ -std=c++0x -g -Wall -pedantic main.cpp -o main
g++ -std=c++0x -g -Wall -pedantic summation.cpp -o summation
Note, you poor saps using Windows will also see average recompiled -- because gmake does not equate "average" with "average.exe". You'll need either a separate makefile or to add some messy conditionals to the file above to get it to not do that -- probably not worth your time for homework. And remember, this is a hack anyway because each makefile really should only be compiling one project.