0

First off, I don't have the appliance, I had to place cs50.h in the same directory as my source code. As you will see from my code I did provide the correct header for that situation.

The error in the title is what Xcode spits out.

When I write the code in note pad, and make it from the terminal, I get this error:

cc     cipher.c   -o cipher
Undefined symbols for architecture x86_64:
"_main", referenced from:
 implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [cipher] Error 1

What am I missing?

1
  • Hmm looks like you didn't follow the right steps to install clang on your machine. Including steps (Windows Installation) here for further reference
    – C--
    Apr 16, 2021 at 10:04

1 Answer 1

0
int main(int argc, const char * argv[])
{
  if (argc != 1)
  {
    printf("you must provide a single integer\n");
    return 1;
  }
  int key = atoi(argv[1]);
}

if(argc != 1) needed to be if(argc != 2) otherwise there wouldn't be and argv[1] there would only be argv[0]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .