$ hoppity.cpp Makefile
/usr/bin/hoppity.cpp: line 4: using: command not found
/usr/bin/hoppity.cpp: line 6: syntax error near unexpected token `('
/usr/bin/hoppity.cpp: line 6: `int main (int argc, char *argv[]) '
You try to run hoppity.cpp as bash script with a single argument - "Makefile". Even if that is not what you wanted, this is what you get.
/usr/bin/hoppity.cpp: line 4: using: command not found
Your file probably starts with several #include .. directives. But # is the prefix character for comments. So "include.." is treated as comment and ignored. Then, on the following line you have usingnamespace std; or something, which among other things runs the "using" command, which is nowhere to be found.
int main (int argc, char *argv[])
{
ifstream readInput;
readInput.open(argv[1]);
int number;
readInput >> number;
for (int i = 1; i <= number; ++i)
{
if (i % 3 == 0 && i % 5 == 0) cout << "Hop\n";
else if (i % 3 == 0) cout << "Hoppity\n";
else if (i % 5 == 0) cout << "Hophop\n";
}
return 0;
}
Well, as I said I'm not competent with *nix. But why do you use the make utility. Why don't you compile with gcc or whatever compiler you use directly like this:
$ gcc hoppity.cpp -o hoppity
$ hoppity
...
Makefiles are a language of their own. They make sense when your project contains more than one implementation file (.cpp).
Typing that will make the shell think that hippity.cpp is a file that it's supposed to execute. It doesn't recognize using as a shell command and doesn't see the first two because the "#" is a comment. If you want to run a makefile, you can just call it "makefile" (I don't think the make command cares for case, but don't quote me on that), go to the directory of that makefile, and type in "$make".
--edit: don't type the "$"... that was supposed to signify the prompt. Just type "make" in the directory with the makefile (if it's not called "makefile" you have to tell it the name).