C compile error with makefile

  • A+
Category:Languages

I have written a program in c and I am using a make file within cygwin on windows to compile the file. Execution is perfectly fine within Visual Studio, however when I try using my make file, the following occurs:

Error:

$ make gcc    -c -o mathTable.o mathTable.c mathTable.c:1:1: error: stray ‘/377’ in program  ▒▒# i n c l u d e   < s t d l i b . h >  ^ mathTable.c:1:2: error: stray ‘/376’ in program  ▒▒# i n c l u d e   < s t d l i b . h >   ^ mathTable.c:1:3: error: stray ‘#’ in program  ▒▒# i n c l u d e   < s t d l i b . h >    ^ mathTable.c:1:4: warning: null character(s) ignored  ▒▒# i n c l u d e   < s t d l i b . h >     ^ mathTable.c:1:6: warning: null character(s) ignored  ▒▒# i n c l u d e   < s t d l i b . h >       ^ mathTable.c:1:5: error: unknown type name ‘i’  ▒▒# i n c l u d e   < s t d l i b . h >      ^ ... ... ... mathTable.c:73:21: warning: null character(s) ignored mathTable.c:73:25: warning: null character(s) ignored mathTable.c:73:27: warning: null character(s) ignored mathTable.c:74:1: warning: null character(s) ignored mathTable.c:75:1: warning: null character(s) ignored mathTable.c:75:3: warning: null character(s) ignored mathTable.c:76:1: warning: null character(s) ignored mathTable.c:77:1: warning: null character(s) ignored mathTable.c:78:1: warning: null character(s) ignored mathTable.c:79:1: warning: null character(s) ignored make: *** [<builtin>: mathTable.o] Error 1 

I am starting to study C so I am not quite sure what could be causing this. It seems bizarre. Maybe something to do with Linux? as I am not handling cross platform (since I didn't think I needed to).

 


This is likely because your file has Windows UTF-16 format. Maybe it contains strings or comments in your native language. Visual C++ compiler understands this, but GCC (Mingw) does not. Save your file in UTF-8 format without marker.

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: