Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
October 19, 2017, 04:56:39 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register Chat  
Pages: [1]   Go Down
  Print  
Author Topic: Problem building exercise for Fraction Calculator - ld: symbol(s) not found for  (Read 11088 times)
jsudol99
Newbie
*
Posts: 3


« on: May 13, 2015, 05:33:25 AM »

Anyone getting this build error using iOs 8.3 with a iPhone 6 plus target?


Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_Calculator", referenced from:
      objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Logged
BrianLawson
Sr. Member
****
Posts: 262


Email
« Reply #1 on: May 13, 2015, 06:43:33 AM »

Zip up your project folder and post it here and I'll take a look at it for you.
Logged
jsudol99
Newbie
*
Posts: 3


« Reply #2 on: May 13, 2015, 07:08:22 AM »

Here it is and thanks
Logged
BrianLawson
Sr. Member
****
Posts: 262


Email
« Reply #3 on: May 13, 2015, 08:59:05 AM »

At the top of ViewController.m there is the statement #import calculator.h. However, the project does not have any calculator.h file, the .m file is present but not the .h file. That is where the linker error is coming from. There is also a Fraction.m without any matching .h file but it is not being imported at this point so no error is showing up.
Logged
BrianLawson
Sr. Member
****
Posts: 262


Email
« Reply #4 on: May 13, 2015, 10:58:24 AM »

I found your calculator.h file and added it to the project and that has not cleared up the error. I'll look some more.
Logged
BrianLawson
Sr. Member
****
Posts: 262


Email
« Reply #5 on: May 13, 2015, 12:34:40 PM »

There is something screwed up in the project settings for your project. Once I got Xcode to recognize your Calculator and Fraction classes and their .m and .h files, I got a bunch of compile errors from the Fraction.m code. I cleared those up and that got rid of the first error message you see but I was unable to clear up the second so I create a new project, deleted the ViewController.h, ViewController.m, and the Main.storyboard files and remiported them along with the Fraction and Calculator class files from you existing project. That allowed me to run your program. Note that the Fraction.m had the code fixes at this point.

I would suggest you create a new project and import your code to it as I described above. That should allow the compiler to see the syntax errors in Fraction.m. Once those have been fixed, you should be in business.
Logged
jsudol99
Newbie
*
Posts: 3


« Reply #6 on: May 13, 2015, 05:40:56 PM »

thanks for your help! crazy rest of week - will look at it on the weekend and try your suggestions
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents ゥ 2009 classroomM.com. All rights reserved.