Trying to build my program and getting the following error. Don't see anything obvious. All my import statements seem correct:
Undefined symbols:
"_OBJC_CLASS_$_DBAccess", referenced from:
objc-class-ref-to-DBAccess in LocationsViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
This sort of problem usually means that the linker isn't finding the class (if your imports are wrong you only get a lexing warning).
Check to make sure that your project is properly linked to whatever uses DBAccess and that DBAccess.m/h is included in the output.
Related
The bridging header file says,
#define qnorm5 Rf_qnorm5
#define qnorm qnorm5
double qnorm5(double, double, double, int, int);
and the code (which compiles!) says
let myresult = qnorm (0.75,0,1,1,0)
but the linker complains
Undefined symbols for architecture x86_64:
"_qnorm", referenced from:
macOS_app_test.ViewController.sayButtonClicked(Any) -> () 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)
From the output, the correct library is found and linked, but the linker does not look for the correct symbol. The symbol the linker should look for, is _Rf_qnorm5.
Apparently, I ought to have understood that the proper function name should be Rf_qnorm5.
Also, there was a problem with XCode actually finding the bridging header file. With both in place, the code works.
I am taking over a really old iPhone project. I am getting these errors when I compile. Do I have libSCFoundationCMSApp.a & libPMAnalytics-r69.a in the wrong locations or am I just missing the libs that the app needs to properly use them?
".objc_class_name_NSNull", referenced from:
literal-pointer#__OBJC#__cls_refs#NSNull in libSCFoundationCMSApp.a(NSDictionaryAdditions.o)
literal-pointer#__OBJC#__cls_refs#NSNull in libSCFoundationCMSApp.a(XMLAdditions.o)
literal-pointer#__OBJC#__cls_refs#NSNull in libSCFoundationCMSApp.a(FMDatabase.o)
literal-pointer#__OBJC#__cls_refs#NSNull in libPMAnalytics-r69.a(Beacon.o)
literal-pointer#__OBJC#__cls_refs#NSNull in libPMAnalytics-r69.a(PMJSONUtils.o)
literal-pointer#__OBJC#__cls_refs#NSNull in libPMAnalytics-r69.a(PMFBXMLHandler.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
It sounds to me more likely that those libraries aren't linked properly to Foundation.framework.
Its complaining that it can't find the NSNull class name as a symbol and that it was referenced from within those libraries.
From what I have read this is supposed to be when the linker (not exactly sure how that works) can't find a symbol. the symbol in question is: SCNetworkReachabilityCreateWithAddress as can be seen from the full error message below.
the thing is that the correct
framework is added to my target.
xcode recognises the symbol OK, i.e.
there is no error message in the .m
file.
the .m file is added to the correct
target so I'm not at all sure what to
do.
Any ideas please?
"SCNetworkReachabilityCreateWithAddress", referenced from:
-[AppWelcomeVC viewDidLoad] in AppWelcomeVC.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Do you have #import <Availability.h> in your AppWelcomeVC class header, or added to your precompiled header (MyApp_Prefix.pch)?
What frameworks do you have in your project?
In the past when I've had this error removing the framework and readding it fixed the problem.
Permissions problems with the framework file itself can also cause this error.
I have the following line of code:
if( !self.isLoading && TTIsEmptyString !TTIsEmptyString(_username) )
and it results in the following error:
Undefined symbols:
"_TTIsEmptyString", referenced from:
-[UserModel load:more:] in UserModel.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
I've read, that linker errors come from 'not included' libraries, but the three20 lib is included in my project.
Any ideas?
I believe the latest version of Three20 removed this method without really making as big of a news flash about it as it should have. It took me a while to troubleshoot this, but basically you just need to change all calls to TTIsEmptyString to TTIsSetWithItems, for example:
if( !self.isLoading && !TTIsSetWithItems(_username) )
I hope this works for you.
I am getting the following error when compiling my code
"_CGRectZero", referenced from:
_CGRectZero$non_lazy_ptr in RootViewController.o
_CGRectZero$non_lazy_ptr in SecondViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Build failed (1 error)
could someone tell me a solution to solve this?
Sounds like your project is missing a framework.
Right-click on the Frameworks folder in your project's Groups & Files column, then select Add > Existing Frameworks...
Choose CoreGraphics.framework from the frameworks list.
Once you rebuild, this error should go away (unless it is something else).