2

I'm trying to compile a program with the CC compiler, but when running the command in Terminal:

cc –o sm hw33.c random.c stopwatch.c –lm

I get this error:

cc: error: –o: No such file or directory
cc: error: sm: No such file or directory
cc: error: –lm: No such file or directory

All the files exist and the names are indeed correct.

What seems to be the problem? Thanks.

Étienne
  • 4,773
  • 2
  • 33
  • 58

1 Answers1

13

The characters in your post aren't - characters. I copy/pasted one and ran it through hexdump:

$ pbpaste | hexdump -vC
00000000  e2 80 93                                          |...|
00000003

Breaking down those bytes in binary gives:

11100010 10000000 10010011

And extracting the unicode code point from them by matching up with the 16-bit code point entry in this chart:

1110xxxx 10xxxxxx 10xxxxxx

Yields:

    0010   000000   010011  --->  0010 0000 0010 0011

Turning that back to hex gives code point 0x2013, which is "EN DASH" according to this unicode chart.

How did you type it? You need an ASCII/UTF-8 - (code point 0x2d, "HYPHEN-MINUS") for the compiler to be able to handle it.

Carl Norum
  • 219,201
  • 40
  • 422
  • 469