Wayne Rumble Wayne Rumble - 1 month ago 7
iOS Question

linker command failed with exit code 1 (use -v to see invocation) using TesseractOCR

I have just installed the tesseraact OCR framework using the github instructions but i keep getting this error when building:

Ld /Users/wayne.rumble/Library/Developer/Xcode/DerivedData/Splitter-fkucamufumrohuhfuivayvewkjdc/Build/Products/Debug-iphoneos/TesseractOCRiOS/TesseractOCR.framework/TesseractOCR normal armv7
cd /Users/wayne.rumble/Documents/iOS/Splitter/Pods
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode_7.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode_7.3.1.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode_7.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -dynamiclib -isysroot /Applications/Xcode_7.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -L/Users/wayne.rumble/Library/Developer/Xcode/DerivedData/Splitter-fkucamufumrohuhfuivayvewkjdc/Build/Products/Debug-iphoneos/TesseractOCRiOS -L/Users/wayne.rumble/Documents/iOS/Splitter/Pods/TesseractOCRiOS/TesseractOCR/lib -F/Users/wayne.rumble/Library/Developer/Xcode/DerivedData/Splitter-fkucamufumrohuhfuivayvewkjdc/Build/Products/Debug-iphoneos/TesseractOCRiOS -filelist /Users/wayne.rumble/Library/Developer/Xcode/DerivedData/Splitter-fkucamufumrohuhfuivayvewkjdc/Build/Intermediates/Pods.build/Debug-iphoneos/TesseractOCRiOS.build/Objects-normal/armv7/TesseractOCR.LinkFileList -install_name @rpath/TesseractOCR.framework/TesseractOCR -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -miphoneos-version-min=8.0 -dead_strip -Xlinker -no_deduplicate -fembed-bitcode-marker -weak_library /usr/lib/libstdc++.6.0.9.dylib -llept -lstdc++ -ltesseract_all -framework Foundation -framework UIKit -fobjc-arc -fobjc-link-runtime -framework Foundation -framework UIKit -single_module -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/wayne.rumble/Library/Developer/Xcode/DerivedData/Splitter-fkucamufumrohuhfuivayvewkjdc/Build/Intermediates/Pods.build/Debug-iphoneos/TesseractOCRiOS.build/Objects-normal/armv7/TesseractOCR_dependency_info.dat -o /Users/wayne.rumble/Library/Developer/Xcode/DerivedData/Splitter-fkucamufumrohuhfuivayvewkjdc/Build/Products/Debug-iphoneos/TesseractOCRiOS/TesseractOCR.framework/TesseractOCR

ld: -weak_library and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
clang: error: linker command failed with exit code 1 (use -v to see invocation)


I'm fairly new to using Swift and Xcode and am struggling to read this error code.

Any help would be much appreciated.

Thanks

Answer
ld: -weak_library and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The linker is telling what the issue is here. I would try turning the Xcode setting ENABLE_BITCODE=YES. to ENABLE_BITCODE=NO and compile again and see if it removes that error. On the project settings view in Xcode you should be able to search for this setting and set to NO.

enter image description here

Comments