I get the following error message when i want to build my project which includes the zxing library:
clang: error: no such file or directory: '/Users/xxxx/Desktop/zxing-2.0/ZXingWidget_Prefix.pch'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
It only happens since i updated xcode to 4.6
Any ideas?
Thanks!
Are you using static zxing library or dependent project?
If dependent project then try below steps:
1) Select project ZXingWidget.xcodeproj
2) Select Targets ZXingWidget
3) Select Build Settings tab
4) Search keyword "header".
5) Set "Precompile Prefix Header" field to "Yes".
6) Set "Prefix Header" field to "ZXingWidget_Prefix.pch".
7) Clean and build your project again.
Hope this would help!
Related
Trying for several days to build my flutter project in iOs (flutter build IPA) and I always seem to receive the same errors :
"_objc_msgSend$setIOSHasWarnedLocationServicesOff:", referenced from:
+[LocationAuthorization run:onCancel:] in TSLocationManager(LocationAuthorization.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
There are a lot of them so I won't be putting all of them here but they're all related to _objc_msgSend$ and TSLocationManager.
I tried to add "-lc++" to Other Linker Flags in Build Settings (Runner Target)., related to this issue https://github.com/facebookarchive/pop/issues/25 but it still failing with more than 100 _objc_msgSend$ issues. I have frankly tried so many things and I'm quite out of clues.
Something I remarked is that when I build from Xcode (Product -» Build), it builds fine when I choose the Destination Device iPhone SE 3rd GEN, but I get the errors when the destination device into my physical device (which is plugged into my Mac).
When I hit flutter build IPA, it always fails.
^_^
First you can update your xcode to version14.0 above.
And the real reason is Apple Clang new optimization scheme._objc_msgSend stup support is not support on xcode13.
If you don't want upgrade your xcode version . You can follow next steps to change your private framework.
I guess you compiled a framework in xcode14 and then used it in xcode13
hh , now i saw you reply , make sure my answer
i'm using Xcode 13.4.1 and it's not having ARCHS_VALID as a build setting #editix –
Bertrand Gélinas
22 hours ago
By default, the clang in Xcode 14 will generate target files that cannot be understood by earlier native linkers.
In the future, it will be recommended to use Xcode14 and above for application package.
If you have private framework build by Xcode14.
Just add -fno-objc-msgsend-selector-stubs to your framework project target build settings other c flags, and build again, replace new framework to your other xcode project
or in your framework project chaneg your podspec file add xcconfig other c flags -fno-objc-msgsend-selector-stubs
or your own script build framework , you can before call xcodebuild command add a change , like thisxcodebuild -project xxx.xcodeproj build OTHER_CFLAGS="-fno-objc-msgsend-selector-stubs "
click on your target > build settings > VALID_ARCHS > and add the following :
arm64 arm64e armv7 armv7s x86_64
in case you didn't find the VALID_ARCHS do the following:
1- Click on the plus sign under the Build Settings.
2- Choose "Add user-defined settings" and it will add NEW_SETTING to you.
3- Rename the "NEW_SETTING" to "VALID_ARCHS" and add the following builds:
arm64 arm64e armv7 armv7s x86_64
if nothing fixed your issue please follow this you may find working answer:
Undefined symbols for architecture arm64
I have a Unity project embedded into Swift 4 and when I build the project I get an error from a plugin named FFmpeg (used to record the screen) and the error is next:
duplicate symbol _LOG_BUFFER_LENGTH in:
/Users/developers/Library/Developer/Xcode/DerivedData/DemoApp-bszfgmzljpyourbdjoxkdabtilki/Build/Intermediates.noindex/DemoApp.build/Debug-iphoneos/DemoApp.build/Objects-normal/arm64/cmdutils.o
/Users/developers/Library/Developer/Xcode/DerivedData/DemoApp-bszfgmzljpyourbdjoxkdabtilki/Build/Intermediates.noindex/DemoApp.build/Debug-iphoneos/DemoApp.build/Objects-normal/arm64/ffmpeg.o
duplicate symbol _LOG_BUFFER_LENGTH in:
/Users/developers/Library/Developer/Xcode/DerivedData/DemoApp-bszfgmzljpyourbdjoxkdabtilki/Build/Intermediates.noindex/DemoApp.build/Debug-iphoneos/DemoApp.build/Objects-normal/arm64/cmdutils.o
/Users/developers/Library/Developer/Xcode/DerivedData/DemoApp-bszfgmzljpyourbdjoxkdabtilki/Build/Intermediates.noindex/DemoApp.build/Debug-iphoneos/DemoApp.build/Objects-normal/arm64/ffmpeg_wrapper.o
duplicate symbol _LOG_BUFFER_LENGTH in:
/Users/developers/Library/Developer/Xcode/DerivedData/DemoApp-bszfgmzljpyourbdjoxkdabtilki/Build/Intermediates.noindex/DemoApp.build/Debug-iphoneos/DemoApp.build/Objects-normal/arm64/cmdutils.o
/Users/developers/Library/Developer/Xcode/DerivedData/DemoApp-bszfgmzljpyourbdjoxkdabtilki/Build/Intermediates.noindex/DemoApp.build/Debug-iphoneos/DemoApp.build/Objects-normal/arm64/intercept.o
ld: 3 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I want to specify that if I export the project from Unity to Xcode without to embed it is working perfectly with this Plugin.
What can be the problem with this error ?
Until now I tried next thing to remove the error but none helped me:
I checked if I have "-ObjC" in Xcode in "Other Linker Flags" and I don't have.
I removed a duplicate library (“libil2cpp.a”) from "Link Binary With Libraries" (XCODE)
I changed 'No Common Blocks' from Yes to No (under Targets->Build Settings->Apple LLVM - Code Generation )
At the end I have the same error.
Here is a print screen:
Thank you so much if you spend your time to read this and any idea will be helpful.
For me this helped:
Step 1: Go to TARGETS -> Build Settings -> No Common Blocks -> No
Step 2: Go to TARGETS -> Build Settings -> enable testability -> No
Additionally you can check Build Phases -> Compile Source. Check duplications.
I finished my game but when I hit run, i'm getting these errors:
I need to change "JohnsPC" to my name!
ld: warning: directory not found for option '-L/Users/JohnsPC/Desktop/Logo Mania?/Code/Yeah/PuzzleGame'
ld: library not found for -lChartboost
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And the second error I have no Clue
How do I fix these?
check the target - Build Settings -> Library Search Path and set proper path for library on your mac
also use macro $(SOURCE_ROOT) to avoid this kind of problem
Try this :
Go to Targets -> Build Phases -> Link Binary With Libraries
Click on + symbol & press Add Other
Select your library
Upon creating a new project I named it o-golfer ( same as my project name )
Then I modified the Identity name to Application
Now when building it again, I get the Apple LLVM 5.0 error, as the cached precompiled header is trying to find again
Is there a way to clear and rebuild this cached header ?
I already tried to clean and build again the project ... same error
clang: error: no such file or directory: '/Users/yves/Developpement/iOS7/OPTIMAL/o-golfer/o-golfer/o-golfer-Prefix.pch'
Here is the error log :
ProcessPCH /Users/yves/Library/Developer/Xcode/DerivedData/o-golfer-cbxwkyokboekvvbscnyxjekgcqyf/Build/Intermediates/PrecompiledHeaders/o-golfer-Prefix-dnguhwlesygrvffouxoeiklsfygm/o-golfer-Prefix.pch.pch o-golfer/o-golfer-Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/yves/Developpement/iOS7/OPTIMAL/o-golfer
setenv LANG en_US.US-ASCII
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/
...
clang: error: no such file or directory: '/Users/yves/Developpement/iOS7/OPTIMAL/o-golfer/o-golfer/o-golfer-Prefix.pch'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Make sure the "Prefix Header" build setting (to get to this, click on your project file in the navigator on the left, then go into the "Build Settings" tab) is set to the correct file name.
I had the same problem, make sure you change the prefix header in your project target and in your "app_name" target and "app_tests" target as well, as one of these being different will still throw the error. Hope this helps ;)
Starting from some point in the past xCode 4 in complaining about linker problems:
ld: warning: building for MacOSX, but linking against dylib built for
iOS:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks//CoreGraphics.framework/CoreGraphics
I have checked everything but still nothing suspicious in the config and it compiles and runs.
The only thing that I see it is double slashes before CoreGraphics.framework, why I do not know. Tried remove and add again library on "Build phases" that did not help.
Sometimes it's easier to debug Xcode problems by looking at the build log for the command lines it's using.
If you're building from the command line, you can get that message if you don't specify -miphoneos-version-min=
This compiles:
(where conftest.c just contains int main() {})
/Applications/Xcode5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 --sysroot /Applications/Xcode5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk --sysroot /Applications/Xcode5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -miphoneos-version-min=6.0 conftest.c
And this gives the error:
/Applications/Xcode5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 --sysroot /Applications/Xcode5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk --sysroot /Applications/Xcode5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk conftest.c
ld: building for MacOSX, but linking against dylib built for iOS Simulator file '/Applications/Xcode5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/libSystem.dylib' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Check your Framework Search Paths for your Main target and your test Target.
I had a lot of crap in mine.
had old project written in XCode 4 and just started to use Unit Tests in XCode 5.
Here's the minimum I have to get my test project to run
Project Navigator > click on project at top >
Targets > Build Settings > Framework Search Paths
TARGET:my_project
$(inherited)
"$(SRCROOT)"
"$(SRCROOT)/my_project"
TEST:my_projectTests
"$(SDKROOT)/Developer/Library/Frameworks" <<XCTest.framework is here
"$(DEVELOPER_LIBRARY_DIR)/Frameworks"
"$(SRCROOT)/.."
"$(SRCROOT)" << Documents/my_project
"$(SRCROOT)/my_project" << Documents/my_project/my_project
where directory structure is
Documents/my_project
my_project.xcodeproj
/my_project
Note: If you drag a framework into XCode. XCode 5 has bad habit of hardcoding the path
/Users/gbxc/Documents/my_project
should be
"$(SRCROOT)" << Documents/my_project
"$(SRCROOT)/my_project" << Documents/my_project/my_project
so if you moved your project might get problems
Best way to check whats correct is to create a new single view project that runs tests ok.
Run the Test action
By default it fails but at least testing is running
then compare the Framework Search Paths.
If you're using Carthage and compiling a Mac app, search on your project's Framework Search Paths you might find something like $(PROJECT_DIR)/Carthage/Build/iOS.
Removing that fixed my issue.
This issue is due to include a wrong framework version in Xcode. The project is built for Mac OS X, but it uses iOS version's framework.