can't map file, errno=22 for architecture x86_64 - objective-c

I'm having a compilation issue
Ld /Users/ppdeveloper/Library/Developer/Xcode/DerivedData/RemoteDesktop-fqnrzezhilkdilddgkfsepetkons/Build/Products/Debug/RemoteDesktop.app/Contents/MacOS/RemoteDesktop normal x86_64
cd /Users/ppdeveloper/Desktop/app/RemoteDesktop
setenv MACOSX_DEPLOYMENT_TARGET 10.5
/Volumes/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/ppdeveloper/Library/Developer/Xcode/DerivedData/RemoteDesktop-fqnrzezhilkdilddgkfsepetkons/Build/Products/Debug -F/Users/ppdeveloper/Library/Developer/Xcode/DerivedData/RemoteDesktop-fqnrzezhilkdilddgkfsepetkons/Build/Products/Debug -filelist /Users/ppdeveloper/Library/Developer/Xcode/DerivedData/RemoteDesktop-fqnrzezhilkdilddgkfsepetkons/Build/Intermediates/RemoteDesktop.build/Debug/RemoteDesktop.build/Objects-normal/x86_64/RemoteDesktop.LinkFileList -mmacosx-version-min=10.5 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -framework Cocoa -framework Foundation -framework AppKit /Users/ppdeveloper/Desktop/app/RemoteDesktop/RemoteDesktop/include -fobjc-link-runtime -framework Foundation -framework CoreData -framework AppKit -framework CoreFoundation -lz -framework Cocoa -o /Users/ppdeveloper/Library/Developer/Xcode/DerivedData/RemoteDesktop-fqnrzezhilkdilddgkfsepetkons/Build/Products/Debug/RemoteDesktop.app/Contents/MacOS/RemoteDesktop
ld: **can't map file, errno=22 for architecture x86_64**
clang: error: **linker command failed with exit code 1 (use -v to see invocation)**

I have no idea where the item /Users/ppdeveloper/Desktop/app/RemoteDesktop/RemoteDesktop/include comes from in your compile/link options, but it looks like a directory, so it’s probably missing a preceeding -I to state that you search in this directory.
If the linker tries to load this directory as a file, it sees an EINVAL aka errno 22.

Related

Clang error:failed with exitcode 1(use -v to see invocation)

I am trying to develop an application in xcode using objective c with SUP backend.When I builded my project I got an error like
Ld /Users/chairman/Library/Developer/Xcode/DerivedData/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Products/Debug-iphonesimulator/New_App.app/New_App normal i386
cd /Users/chairman/Desktop/New_App/New_App
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Users/chairman/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Users/chairman/Desktop/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Users/chairman/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Users/chairman/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/chairman/Library/Developer/Xcode/DerivedData/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Products/Debug-iphonesimulator -L/Users/chairman/Desktop/New_App/New_App/../../MAC_IOS/importing_Libraries/Libraries/Debug-iphoneos -L/Users/chairman/Desktop/New_App/New_App/../../MAC_IOS/importing_Libraries/Libraries/Debug-iphonesimulator -L/Users/chairman/Desktop/New_App/New_App/../../MAC_IOS/importing_Libraries/Libraries/Release-iphoneos -L/Users/chairman/Desktop/New_App/New_App/../../MAC_IOS/importing_Libraries/Libraries/Release-iphonesimulator -L/Users/chairman/Desktop/New_App/New_App/../../New_App_Data/importing_Libraries/Libraries/Debug-iphonesimulator -F/Users/chairman/Library/Developer/Xcode/DerivedData/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Products/Debug-iphonesimulator -filelist /Users/chairman/Library/Developer/Xcode/DerivedData/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Intermediates/New_App.build/Debug-iphonesimulator/New_App.build/Objects-normal/i386/New_App.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -lstdc++.6 -lz.1.2.5 -licucore.A -framework Security -framework QuartzCore -framework CoreFoundation -framework AddressBook -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/chairman/Library/Developer/Xcode/DerivedData/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Products/Debug-iphonesimulator/New_App.app/New_App
ld: duplicate symbol _OBJC_IVAR_$_dev_BhaskarG_com_igate_shipping_v1KeyGenerator._remoteId in /Users/chairman/Library/Developer/Xcode/DerivedData/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Intermediates/New_App.build/Debug-iphonesimulator/New_App.build/Objects-normal/i386/dev_BhaskarG_com_igate_shipping_v1KeyGenerator.o and /Users/chairman/Library/Developer/Xcode/DerivedData/New_App-brpimxjxwxsuimcjcfjjrmpnextw/Build/Intermediates/New_App.build/Debug-iphonesimulator/New_App.build/Objects-normal/i386/dev_BhaskarG_com_igate_shipping_v1KeyGenerator copy.o for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can anyone please help me in solving this?
Duplicate symbol means you have the same symbol (class, variable, etc) defined in two places in your project (or its included libraries).
Look at the error messages...it looks like you've included the same file in your project twice:
dev_BhaskarG_com_igate_shipping_v1KeyGenerator
dev_BhaskarG_com_igate_shipping_v1KeyGenerator copy

Error "file not found: -fobjc-arc" on compiling IOS App in XCode

after adding the OCMock framework i got that strange error... :(
ld: file not found: -fobjc-arc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It looks like if the compiler flag tries to be loaded by XCode?
Any idea?
Best regards, hijolan
I was getting the exact same error on Xcode 4.3.2. Here's my navigator log; I'm adding it for Google juice.
Ld /Users/makdad/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator/JournalTests.octest/JournalTests normal i386
cd /Users/makdad/Documents/MT/mt-mobile/iOS/Journal
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator -F/Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Intermediates/Journal.build/Debug-iphonesimulator/JournalTests.build/Objects-normal/i386/JournalTests.LinkFileList -mmacosx-version-min=10.6 -bundle_loader /Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator/Journal.app/Journal -Xlinker -objc_abi_version -Xlinker 2 -ObjC -force_load -fobjc-arc -ftest-coverage -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -lOCMock -framework Twitter -framework MapKit -framework MobileCoreServices -framework SystemConfiguration -lxml2 -licucore -framework CoreData -framework CoreGraphics -framework CFNetwork -framework QuartzCore -framework SenTestingKit -framework UIKit -framework Foundation -o /Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator/JournalTests.octest/JournalTests
The OCMock instructions explicitly ask you to add linker flags -- -ObjC and -force_load.
-force_load is expecting a value -- see the answer to this question that explains that -all_load is what to use if you don't want to specify a library name.
As someone who just spent 25 minutes on this, I should check again with the OCMock tutorial -- I don't think it was very clear in this instruction.
This blog post has a much better image that shows exactly how your settings should look.

Xcode error: ld: library not found for -lgomp

I'm compiling a project in Objective-C depending on libraries in C.
The compilation fails with the following error:
Ld /Users/user/Library/Developer/Xcode/DerivedData/MyProject-enqkiqdfplxedfeowxlkwfgadtyz/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp normal i386
cd /Users/user/Documents/XCodeWorkspace/MyProject/Subproject
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/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/user/Library/Developer/Xcode/DerivedData/MyProject-enqkiqdfplxedfeowxlkwfgadtyz/Build/Products/Debug-iphonesimulator -L/Users/user/Documents/XCodeWorkspace/MyProject/Subproject/../../../../../Library/Developer/Xcode/DerivedData/MyProject-enqkiqdfplxedfeowxlkwfgadtyz/Build/Products/Debug-iphoneos -F/Users/user/Library/Developer/Xcode/DerivedData/MyProject-enqkiqdfplxedfeowxlkwfgadtyz/Build/Products/Debug-iphonesimulator -filelist /Users/user/Library/Developer/Xcode/DerivedData/MyProject-enqkiqdfplxedfeowxlkwfgadtyz/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fopenmp -licucore -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -lamsip -lcares -lexosip2 -lgsm -lmediastreamer2 -lspeex -lsrtp -lsqlite3.0 -framework MessageUI -framework AudioToolbox -framework AVFoundation -lz -framework AddressBook -framework AddressBookUI -framework Foundation -framework UIKit -framework CoreGraphics -framework SystemConfiguration -framework CoreTelephony -lTestFlight -o /Users/user/Library/Developer/Xcode/DerivedData/MyProject-enqkiqdfplxedfeowxlkwfgadtyz/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp
ld: library not found for -lgomp
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
The problem I see is that this library isn't even specified in the link command! Why is this needed at all?
Yours,
Emmanuel
Someone had enabled OpenMP using "other flags" which causes the -lgomp library to be included. :-(

Getting libtool failed with exit code 1 error. What do i do?

The exact error is :
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1
Libtool /Users/dkatz/Library/Developer/Xcode/DerivedData/RWACommon-asaaevxqjainigcczkcvgrxvpyyp/Build/Products/Debug-iphonesimulator/RWACommon.framework/Versions/A/RWACommon normal i386
cd /Users/dkatz/Sites/xCode/RWA/RWACommon
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only i386 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/dkatz/Library/Developer/Xcode/DerivedData/RWACommon-asaaevxqjainigcczkcvgrxvpyyp/Build/Products/Debug-iphonesimulator -filelist /Users/dkatz/Library/Developer/Xcode/DerivedData/RWACommon-asaaevxqjainigcczkcvgrxvpyyp/Build/Intermediates/RWACommon.build/Debug-iphonesimulator/RWACommon.build/Objects-normal/i386/RWACommon.LinkFileList -framework MessageUI -framework CoreGraphics -framework CoreText -framework QuartzCore -framework UIKit -framework Foundation -framework GData -o /Users/dkatz/Library/Developer/Xcode/DerivedData/RWACommon-asaaevxqjainigcczkcvgrxvpyyp/Build/Products/Debug-iphonesimulator/RWACommon.framework/Versions/A/RWACommon
Thanks guys. (I am using xcode 4.3 btw)
Refer to this solution that i have provided you at the following link
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1

Getting rid of linker warning in XCode

How do I get rid of this linker warning that appears every time I build my project in XCode?
Ld build/Sidestep.build/Release/Sidestep.build/Objects-normal/x86_64/Sidestep normal x86_64
cd /Users/Chetan/Development/Sidestep
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Developer/usr/bin/gcc-4.2 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -L/Users/Chetan/Development/Sidestep/build/Release -F/Users/Chetan/Development/Sidestep/build/Release -F/Users/Chetan/Development/Sidestep/frameworks -F/Users/Chetan/Development/Sidestep -filelist /Users/Chetan/Development/Sidestep/build/Sidestep.build/Release/Sidestep.build/Objects-normal/x86_64/Sidestep.LinkFileList -mmacosx-version-min=10.6 -framework Security -framework Cocoa -framework SystemConfiguration -framework IOKit -framework Sparkle -o /Users/Chetan/Development/Sidestep/build/Sidestep.build/Release/Sidestep.build/Objects-normal/x86_64/Sidestep
ld: warning: directory '/Users/Chetan/Development/Sidestep/frameworks' following -F not found
I don't have the folder /Users/Chetan/Development/Sidestep/frameworks anymore, since I deleted it.
Remove that directory from the "framework search paths" in the build settings for the project, or for that target.