First of all, Happy New Year to anybody out there reading this!
I have an i-phone app I am working on and wanted to make an enhancement to an IBACTION (GetNextElement) which is called from a button tap. I wanted to call a function (get_index_to_use) rather than insert the code in GetNextElement. When I call the function in my SymbolTest.m file, I get a warning "implicit declaration of function get_index_to_use".
I get an error on the build that I don't see unless I go into Build Results where I see the following:
Ld build/Debug-iphonesimulator/elements1.app/elements1 normal i386 cd /Users/dad/Documents/elements1 setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/dad/Documents/elements1/build/Debug-iphonesimulator -F/Users/dad/Documents/elements1/build/Debug-iphonesimulator -filelist /Users/dad/Documents/elements1/build/elements1.build/Debug-iphonesimulator/elements1.build/Objects-normal/i386/elements1.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/dad/Documents/elements1/build/Debug-iphonesimulator/elements1.app/elements1
Undefined symbols: "_get_index_to_use", referenced from: -[SymbolTest GetNextElement:] in SymbolTest.o ld: symbol(s) not found collect2: ld returned 1 exit status
I'm not familiar with SymbolTest.o.
I have my function in the code before GetNextElement. I tried to put it in SymbolTest.h. I tried to put it in GetNextElement but couldn't get that to work either. I have tried - and +. The function looks like this (eventually I want to change how I calculate the index, but for now I am just incrementing it to get the function to work):
- (void)get_index_to_use {
el_tbl_idx++;
}
Any help would be appreciated. Thanks.