-
gcc -c error
Hi.
Im having some trouble creating some object files using the c flag for gcc
fred.c
Code:
#include <stdio.h>
void fred(int arg)
{
printf(fred: you passed %d\n, arg);
}
bill.c
Code:
#include <stdio.h>
void bill(char *arg)
{
printf(bill: you passed %s\n, arg);
}
Code:
$gcc -c fred.c - fred.c bill.c
fred.c: In function fred:
fred.c:5: error: stray \342 in program
fred.c:5: error: stray \200 in program
fred.c:5: error: stray \234 in program
fred.c:5: error: expected ) before : token
fred.c:5: error: stray \ in program
fred.c:5: error: stray \342 in program
fred.c:5: error: stray \200 in program
fred.c:5: error: stray \235 in program
fred.c:5: warning: passing argument 1 of printf from incompatible pointer type
bill.c: In function bill:
bill.c:5: error: stray \342 in program
bill.c:5: error: stray \200 in program
bill.c:5: error: stray \234 in program
bill.c:5: error: expected ) before : token
bill.c:5: error: stray \ in program
bill.c:5: error: stray \342 in program
bill.c:5: error: stray \200 in program
bill.c:5: error: stray \235 in program
bill.c:5: warning: passing argument 1 of printf from incompatible pointer type
Google is of no help on this one. It should create fred.o and bill.o. Strange.
Any ideas?
-
OK, that was really annoying. Right after I posted that I noticed the double quotes looked wierd. So I edited fred.c and bill.c and replaced them with normal double quotes and voila! Personally, I don't see how there can be an alternative double quote but there you have it. :confused:
Code:
$ gcc -c bill.c fred.c
$ ls *.o
bill.o fred.o
swish
-
Those are the "pretty" quotes used for typesetting. For programming, such things are quite useless, of course.
-
Haha ok. I copied it over from a pdf file, which explains everything really.