Application Tool Kit

Linking Errors when compiling with Swift

Hi,

I am trying to integrate the MathWidget into a swift application. Currently, the I am receiving this error when trying to run the application:

Ld build/Debug-iphonesimulator/FinalProject.app/FinalProject normal x86_64
cd "/Users/kbai/Documents/XCode Projects/ios/FinalProject"
export IPHONEOS_DEPLOYMENT_TARGET=10.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -L/Users/kbai/Documents/XCode Projects/ios/FinalProject/build/Debug-iphonesimulator -F/Users/kbai/Documents/XCode Projects/ios/FinalProject/build/Debug-iphonesimulator -F/Users/kbai/MyScript_ATK-ios-2/Frameworks -filelist /Users/kbai/Documents/XCode Projects/ios/FinalProject/build/FinalProject.build/Debug-iphonesimulator/FinalProject.build/Objects-normal/x86_64/FinalProject.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=10.1 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/kbai/Documents/XCode Projects/ios/FinalProject/build/FinalProject.build/Debug-iphonesimulator/FinalProject.build/Objects-normal/x86_64/FinalProject_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/kbai/Documents/XCode Projects/ios/FinalProject/build/FinalProject.build/Debug-iphonesimulator/FinalProject.build/Objects-normal/x86_64/FinalProject.swiftmodule -ObjC -lstdc++ -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/kbai/Documents/XCode Projects/ios/FinalProject/build/FinalProject.build/Debug-iphonesimulator/FinalProject.build/FinalProject.app.xcent -framework ATKMathWidget -framework SystemConfiguration -framework ATKMath -framework ATKCore -Xlinker -dependency_info -Xlinker /Users/kbai/Documents/XCode Projects/ios/FinalProject/build/FinalProject.build/Debug-iphonesimulator/FinalProject.build/Objects-normal/x86_64/FinalProject_dependency_info.dat -o /Users/kbai/Documents/XCode Projects/ios/FinalProject/build/Debug-iphonesimulator/FinalProject.app/FinalProject

Undefined symbols for architecture x86_64:
"_myCertificate_BYTES", referenced from:
_myCertificate 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)


I have put the certificate and #import <ATKMathWidget/MAWMathWidget.h> into the bridging header and am accessing them in my swift classes.

How can I resolve this problem?


Dear Kevin,

Similar trouble have been reported by other developers and it seems to be due to the Xcode build settings. Could you please check the set Linker Flag?
See similar post:
https://developer-support.myscript.com/support/discussions/topics/16000007943
https://developer-support.myscript.com/support/discussions/topics/16000007933

Best regards and Merry Christmas!

Dear Cate,

I have already tried to set the -undefined dynamic_lookup and it does not seem to work. It is also deprecated. I currently only have the -ObjC and the -lstdc++ flags linked. Also, adding the 'All load' flag does not change anything.

Best regards,

Kevin

Dear Kevin,

Based on the log information, it looks like your certificate file was not properly added to your project: Can you please add it properly and see if it solves the issue?

Best regards,

Olivier

Login or Signup to post a comment