Amazon.com Widgets Undefined Symbols Error -- in Prog 11.1!
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 21, 2013, 08:11:36 PM
Home Help Search chat Login Register   
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+  Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+  Old Stuff
| |-+  Answers to Exercises
| | |-+  Chapter 11
| | | |-+  Undefined Symbols Error -- in Prog 11.1!
Pages: [1]   Go Down
Print
Author Topic: Undefined Symbols Error -- in Prog 11.1!  (Read 366 times)
Learner
Newbie
*
Posts: 21


Email




« on: December 03, 2011, 12:44:16 PM »

I have correctly completed the program 11.1 for adding a category to the Fraction class. However, when I used the terminal to run the program, I get this:

Quote
Undefined symbols:
  "_gCounter", referenced from:
      +[Fraction allocF] in ccdAhuuP.o
      +[Fraction allocF] in ccdAhuuP.o
      +[Fraction count] in ccdAhuuP.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

This allocF is from chapter 10.

I used the gcc compiler statement:

Quote
gcc -framework Foundation Fraction.m NewFraction.m -o Main

NewFraction.m is the name of the program with all the interface, implementation, and main.m code for prog 11.1

Not sure why it's giving me that error, especially since I haven't even called that particular method.
Logged
Learner
Newbie
*
Posts: 21


Email




« Reply #1 on: December 03, 2011, 01:01:25 PM »

Problem solved.

I forgot to put the
Code: (Objective-C)
 static int gCounter;

at the top of the Fraction.m file.
Logged
Pages: [1]   Go Up
Print
Jump to:  



Login with username, password and session length

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 (c) 2009 classroomM.com. All rights reserved.