-
gcc compile problem
I am having problems compiling code, I am using gcc --version 3.2.2-3mdk, using the command gcc -D_GNU_SOURCE test.c -o test. Following is the well renound ´hello world´ intro prog which i am using as a test to try and find where the problem is. Following the code is the output i recevie on the console.
Code:
#include <stdio.h>
int main(int argc, char **argv) {
(void) argc;
(void) argv;
printf(¨hello world!\n¨);
return 0;
}
test.c: In function `main':
test.c:8: stray '\250' in program
test.c:8: `hello' undeclared (first use in this function)
test.c:8: (Each undeclared identifier is reported only once
test.c:8: for each function it appears in.)
test.c:8: parse error before "world"
test.c:8: stray '\' in program
test.c:8: stray '\250' in program
This has got me stumped as it is happening for all code I try to compile, non of which is very advanced as i am relativly a newb. (btw: this used to work in an older version i had of gcc)
Any help would be greatly appreciated.
Keyz
-
Thanks for that but im not sure itś quite right, I just typed that up myself before using ¨kwrite¨ which is really just like notepad. I likewise noticed the funny ¨ ¨ but that is just how they come up when I type it on the keyboard. I am currently using mdk 9.1, and am thinking of going back to mdk 8.2 because there using the same combination of kwrite, ¨ ¨ ś and the older gcc it worked. But if you have any further ideas please let me know. Also thanks again for the reply.
btw: just tryed using both emacs and vi and everyother text editor I have and i get exactly the same error message (I retype the code everytime, not copy/paste)
Keyz
-
Yeah, its definitely a problem with the double quotes.
-
Thank's to both of your input I have found the solution! The problem did lie with the dodgy "" I had before. To ammend this I changed the keyboard layout settings to US international keyboard. So if anyone else is as silly as me and has the same problem check your keyboard layout settings!
And I will keep that in mind if a similar problem every arises again Salem.
Btw: kwrite is a great little text editor for doing c and many other languages in and it has no problems once you have good "". Should probaly give it a go, if your interested.
Thank's again!
Keyz