0

referencing this post - link

I have my function declared in my header file, however the error -"Implicit declaration of function invalid in c99" still shows. I am not sure however if that is ultimately what is causing my final error which is "ld: symbol(s) not found for architecture x86_64"

I tried changing the architecture in build settings to 386, without luck.

enter image description here

enter image description here

Community
  • 1
  • 1
mparrish91
  • 101
  • 3
  • 11

1 Answers1

1

Calling an Objective-C method looks different than calling a C function. In this instance, you've written a method -printKthToLast:withHead:, and you'll need to call it on an object like so:

int index = [self printKthToLast:k withHead:head.next] + 1;

Note the use of square brackets around the entire method call; the receiver, in this case self; the individual argument labels; and the lack of parentheses.

Tim
  • 59,527
  • 19
  • 156
  • 165