Cocos2D 2.0 upgrade: Apple Mach-O Linker Error - cocos2d-iphone

I'm almost done upgrading Cocos2D from 0.99.5 to 2.1, but I don't know how to resolve this error. This is what shows up as the error:
Ld /Users/Admin/Library/Developer/Xcode/DerivedData/flyingAdventure-esbllafxkpvprvdfdsnfuyectjnh/Build/Products/Debug-iphonesimulator/Flying\ Adventure.app/Flying\ Adventure normal i386
cd /Users/Admin/Documents/EriksFiles/Erik/iPad/cocos2d/flyingAdventure/flyingAdventure_current
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
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 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/Admin/Library/Developer/Xcode/DerivedData/flyingAdventure-esbllafxkpvprvdfdsnfuyectjnh/Build/Products/Debug-iphonesimulator -F/Users/Admin/Library/Developer/Xcode/DerivedData/flyingAdventure-esbllafxkpvprvdfdsnfuyectjnh/Build/Products/Debug-iphonesimulator -filelist /Users/Admin/Library/Developer/Xcode/DerivedData/flyingAdventure-esbllafxkpvprvdfdsnfuyectjnh/Build/Intermediates/flyingAdventure.build/Debug-iphonesimulator/flyingAdventure1.build/Objects-normal/i386/Flying\ Adventure.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -all_load -ObjC -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -lcocos2d\ libraries -framework CoreText -framework GameKit -lz.1.2.5 -framework CoreGraphics -framework Foundation -framework OpenGLES -framework QuartzCore -framework UIKit -framework AudioToolbox -framework OpenAL -lz -framework AVFoundation -Xlinker -dependency_info -Xlinker /Users/Admin/Library/Developer/Xcode/DerivedData/flyingAdventure-esbllafxkpvprvdfdsnfuyectjnh/Build/Intermediates/flyingAdventure.build/Debug-iphonesimulator/flyingAdventure1.build/Objects-normal/i386/Flying\ Adventure_dependency_info.dat -o /Users/Admin/Library/Developer/Xcode/DerivedData/flyingAdventure-esbllafxkpvprvdfdsnfuyectjnh/Build/Products/Debug-iphonesimulator/Flying\ Adventure.app/Flying\ Adventure
ld: library not found for -lcocos2d libraries
Library not found for -lcocos2d libraries
Linker command failed with exit code 1 (use -v to see invocation)
Does it have to do with my Link Binary With Libraries? Here's what that looks like:

Related

clang: error: linker command failed with exit code 1 (use -v to see invocation) XCode and wxWidgets

I'm trying to start a project in XCode 8 using wxWidgets 3.1.0 on OS X 10.11
After downloading wxWidgets-3.1.0 I've built and make everything according to the /docs/osx/install.txt
Now I tried to create a new project and followed their guide: https://wiki.wxwidgets.org/Creating_Xcode_projects_for_wxWidgets_applications
I followed almost every step exactly as instructed. (Static and Debug)
I didn't find the Summary Tab and a Choose Info.plist File Button, I chose it over General under Identity (which may be the same)
Then I tried to compile and run.
I'm getting Warnings and 1 Error.
Warning: Telling me to check dependencies
wxcocoa.xcconfig line 3: Unable to find included file "wx.xcconfig"
Warning: The Copy Bundle Resources build phase contains this target's Info.plist file '/Users/me/Desktop/git/xcode/wx_mac_xcode/Info_cocoa.plist'.
Error:
Ld /Users/me/Library/Developer/Xcode/DerivedData/wx_mac_xcode-bhbnjqgpmqtgwxhfxmjhvrtjnraz/Build/Products/Debug/Static.app/Contents/MacOS/Static normal x86_64
cd /Users/me/Desktop/git/xcode/wx_mac_xcode
export MACOSX_DEPLOYMENT_TARGET=10.5
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/Users/me/Library/Developer/Xcode/DerivedData/wx_mac_xcode-bhbnjqgpmqtgwxhfxmjhvrtjnraz/Build/Products/Debug -F/Users/me/Library/Developer/Xcode/DerivedData/wx_mac_xcode-bhbnjqgpmqtgwxhfxmjhvrtjnraz/Build/Products/Debug -filelist /Users/me/Library/Developer/Xcode/DerivedData/wx_mac_xcode-bhbnjqgpmqtgwxhfxmjhvrtjnraz/Build/Intermediates/wx_mac_xcode.build/Debug/Static.build/Objects-normal/x86_64/Static.LinkFileList -Xlinker -rpath -Xlinker #executable_path/../Frameworks -mmacosx-version-min=10.5 -Xlinker -no_deduplicate -framework WebKit -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework OpenGL -framework QTKit -framework WebKit -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework OpenGL -framework QTKit -lz -stdlib=libstdc++ -lwx_osx_cocoa_static -Xlinker -dependency_info -Xlinker /Users/me/Library/Developer/Xcode/DerivedData/wx_mac_xcode-bhbnjqgpmqtgwxhfxmjhvrtjnraz/Build/Intermediates/wx_mac_xcode.build/Debug/Static.build/Objects-normal/x86_64/Static_dependency_info.dat -o /Users/me/Library/Developer/Xcode/DerivedData/wx_mac_xcode-bhbnjqgpmqtgwxhfxmjhvrtjnraz/Build/Products/Debug/Static.app/Contents/MacOS/Static
ld: library not found for -lwx_osx_cocoa_static
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Double checked every step, but don't know how to fix those dependencies.
Project and library are debug mode
Cheers

linker command failed with exit code 1 clang:error

Ld /Users/simona/Library/Developer/Xcode/DerivedData/HelvetiQuiz-euzcyknolfniushksjdmyofanxpr/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/HelvetiQuiz.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/HelvetiQuiz normal armv7
cd /Users/simona/Desktop/Ios
export IPHONEOS_DEPLOYMENT_TARGET=4.3
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -L/Users/simona/Library/Developer/Xcode/DerivedData/HelvetiQuiz-euzcyknolfniushksjdmyofanxpr/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/BuildProductsPath -F/Users/simona/Library/Developer/Xcode/DerivedData/HelvetiQuiz-euzcyknolfniushksjdmyofanxpr/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/BuildProductsPath -filelist /Users/simona/Library/Developer/Xcode/DerivedData/HelvetiQuiz-euzcyknolfniushksjdmyofanxpr/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/HelvetiQuiz.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/HelvetiQuiz.LinkFileList -dead_strip -weak_framework CoreMotion -weak-lSystem -stdlib=libstdc++ -fobjc-link-runtime -miphoneos-version-min=4.3 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework OpenAL -liconv.2 -liPhone-lib -framework AudioToolbox -framework CFNetwork -framework MediaPlayer -framework CoreLocation -framework SystemConfiguration -weak_framework iAd -framework CoreMedia -framework CoreVideo -weak_framework AVFoundation -framework CoreGraphics -weak_framework CoreMotion -weak_framework GameKit -Xlinker -dependency_info -Xlinker /Users/simona/Library/Developer/Xcode/DerivedData/HelvetiQuiz-euzcyknolfniushksjdmyofanxpr/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/HelvetiQuiz.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/HelvetiQuiz_dependency_info.dat -o /Users/simona/Library/Developer/Xcode/DerivedData/HelvetiQuiz-euzcyknolfniushksjdmyofanxpr/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/HelvetiQuiz.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/HelvetiQuiz
ld: library not found for -liPhone-lib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I get this error whenn I try to compile my app. What can I do?
These articles may be of use:
http://answers.unity3d.com/questions/538363/error-when-i-updated-to-xcode-5-to-get-import-to-i.html
http://xyglo.com/blog/2013/11/06/xcode-linker-mystery/
Some quick googling turns up a lot of cases where unity users have had this issue and it is related to the Library Search Path settings (Project -> target -> build settings).

iOS App runs fine in Simulator but is not archiving "Mach-O-Linker"-Error"

Error Message:
Ld /Users/xxx/Library/Developer/Xcode/DerivedData/instrument_crate-aciaeoafecwxcmgsthlralpykqct/Build/Intermediates/ArchiveIntermediates/instrument_crate/IntermediateBuildFilesPath/instrument_crate.build/Release-iphoneos/instrument_crate.build/Objects-normal/armv7/instrument_crate normal armv7
cd /Users/xxx/Desktop/instrument_crate/platforms/ios
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -L/Users/xxx/Library/Developer/Xcode/DerivedData/instrument_crate-aciaeoafecwxcmgsthlralpykqct/Build/Intermediates/ArchiveIntermediates/instrument_crate/BuildProductsPath/Release-iphoneos -F/Users/xxx/Library/Developer/Xcode/DerivedData/instrument_crate-aciaeoafecwxcmgsthlralpykqct/Build/Intermediates/ArchiveIntermediates/instrument_crate/BuildProductsPath/Release-iphoneos -filelist /Users/xxx/Library/Developer/Xcode/DerivedData/instrument_crate-aciaeoafecwxcmgsthlralpykqct/Build/Intermediates/ArchiveIntermediates/instrument_crate/IntermediateBuildFilesPath/instrument_crate.build/Release-iphoneos/instrument_crate.build/Objects-normal/armv7/instrument_crate.LinkFileList -dead_strip -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -force_load /Users/xxx/Library/Developer/Xcode/DerivedData/instrument_crate-aciaeoafecwxcmgsthlralpykqct/Build/Intermediates/ArchiveIntermediates/instrument_crate/InstallationBuildProductsLocation/Applications/libCordova.a -ObjC -fobjc-link-runtime -miphoneos-version-min=7.0 -framework CoreMIDI -framework CoreLocation -framework ImageIO -framework OpenAL -framework AssetsLibrary /Users/xxx/Library/Developer/Xcode/DerivedData/instrument_crate-aciaeoafecwxcmgsthlralpykqct/Build/Intermediates/ArchiveIntermediates/instrument_crate/BuildProductsPath/Release-iphoneos/libCordova.a -framework Foundation -weak_framework UIKit -framework CoreGraphics -framework AddressBook -framework AddressBookUI -framework AudioToolbox -weak_framework AVFoundation -framework CFNetwork -framework MediaPlayer -framework QuartzCore -framework SystemConfiguration -framework MobileCoreServices -weak_framework CoreMedia -framework CoreLocation -Xlinker -dependency_info -Xlinker /Users/xxx/Library/Developer/Xcode/DerivedData/instrument_crate-aciaeoafecwxcmgsthlralpykqct/Build/Intermediates/ArchiveIntermediates/instrument_crate/IntermediateBuildFilesPath/instrument_crate.build/Release-iphoneos/instrument_crate.build/Objects-normal/armv7/instrument_crate_dependency_info.dat -o /Users/xxx/Library/Developer/Xcode/DerivedData/instrument_crate-aciaeoafecwxcmgsthlralpykqct/Build/Intermediates/ArchiveIntermediates/instrument_crate/IntermediateBuildFilesPath/instrument_crate.build/Release-iphoneos/instrument_crate.build/Objects-normal/armv7/instrument_crate
ld: file not found: /Users/xxx/Library/Developer/Xcode/DerivedData/instrument_crate-aciaeoafecwxcmgsthlralpykqct/Build/Intermediates/ArchiveIntermediates/instrument_crate/InstallationBuildProductsLocation/Applications/libCordova.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
(null): File not found: /Users/xxx/Library/Developer/Xcode/DerivedData/instrument_crate-aciaeoafecwxcmgsthlralpykqct/Build/Intermediates/ArchiveIntermediates/instrument_crate/InstallationBuildProductsLocation/Applications/libCordova.a
The SDK I am using requires Mac OS X 10.8, Xcode 5.1, CLI and Cordova 2.9. I use exact those Tools. Would be very nice if anybody would help me.
Go to targets -> Build Phases -> Link Binary with Libraries -> Add libCordova.a library from your project
Clean & build project
Hope it will help to you.

Diagnosing "contains undefined reference for architecture" at linking phase

I'm trying to build a x86_64 application on MacOSX, using qmake/qt. I was able to compile in QT4, but not in QT5.
Anyway, after running qmake to generate my makefiles etc:
qmake -recursive -spec macx-clang app.pro CONFIG+='release static'
Then when I run make, eventually I end up here:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -headerpad_max_install_names -arch x86_64 -Wl,-dead_strip -framework Cocoa -framework Carbon -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.6 -o (...author's note--tons of .o files here...) -L../lib -L../../debug -F/Users/seth/workspace/qt5.1.0//5.1.0/clang_64/lib -lprotobuf -framework Security -framework SecurityInterface -framework ApplicationServices -framework CoreFoundation -lxml2 -lbz2 -lxar -framework ScriptingBridge -L/Users/seth/workspace/qt5.1.0//5.1.0/clang_64/plugins/iconengines -lssl -lcrypto -lz -lFLAC -framework Carbon -framework QtWebKitWidgets -framework QtQuick -framework QtQml -framework QtNetwork -framework QtCore -framework QtGui -framework QtOpenGL -framework QtWidgets -framework QtPrintSupport -framework Cocoa -framework QtWebKit -framework QtSql -framework QtSensors -framework QtSvg -framework QtXml -framework OpenGL -framework AGL
ld: '__ZN3Log16DebugE7QStringS3_' in debug/Log.o contains undefined reference for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I do not understand what 'undefined reference for architecture x86_64' means, and that's certainly the heart of the problem. Upon reading some other threads, some suggest that the libraries I'm linking against aren't x86_64, but after checking and rechecking, I can't find any non-x86_64 libraries involved in the process.
All my .o files from the build are Mach-O 64-bit object x86_64, after checking with the file command.
And for all libraries that I'm trying to reference (like libcrypto, for instance):
Non-fat file: ../lib/libcrypto.a is architecture: x86_64
And of course all the mac framework libraries are both 32/64bit capable.
Does anyone have any suggestions on how I could debug this further?
Been fiddling all day, found it.
The method that the link is complaining about has this in it:
qt_mac_execute_apple_script
This method does not exist in qt5.
Also, earlier in the problematic file, I have this:
extern bool qt_mac_execute_apple_script(const QString &script, AEDesc *ret);
if i comment these lines, the error goes away.
So basically, a very bad compiler error for a missing symbol – because the compiler wasn’t nice enough to point out what the actual problem is beyond the vague architecture statement; probably made worse because I’m building my application statically coupled with the extern.

framework not found issue when linking a framework within a framework

I have a framework(FRAME1) that includes versions a b and c this is then included as a dependency within another framework(FRAME2).
However when I build FRAME2 it dies out with: ld:framework not found <nameofframework>
I have made the install location of the frame1 to /Library/Frameworks and I have also set it as #rpath
however frame2 still errors out. I have hard coded the framework search paths and that also doesnt change the situation.
here is the xcode error output:
Ld build/Release/TSVideoAppKit.framework/Versions/B/TSVideoAppKit normal i386
cd /Users/benb/Projects/Telestream/swRelease/Pipeline/2.6/Dib/Code/Macintosh/Frameworks/TSVideoAppKit
setenv MACOSX_DEPLOYMENT_TARGET 10.5
/Xcode3/usr/bin/g++-4.0 -arch i386 -dynamiclib -isysroot /Xcode3/SDKs/MacOSX10.6.sdk -L/Users/benb/Projects/Telestream/swRelease/Pipeline/2.6/Dib/Code/Macintosh/Frameworks/TSVideoAppKit/build/Release -F/Users/benb/Projects/Telestream/swRelease/Pipeline/2.6/Dib/Code/Macintosh/Frameworks/TSVideoAppKit/build/Release -filelist /Users/benb/Projects/Telestream/swRelease/Pipeline/2.6/Dib/Code/Macintosh/Frameworks/TSVideoAppKit/build/TSVideoAppKit.build/Release/TSVideoAppKitFramework.build/Objects-normal/i386/TSVideoAppKit.LinkFileList -install_name /Library/Frameworks/TSVideoAppKit.framework/Versions/B/TSVideoAppKit -Xlinker -rpath -Xlinker /Library/Frameworks -mmacosx-version-min=10.5 -framework TSPipelineEngine -framework Cocoa -framework CoreVideo -framework OpenGL -framework QTKit -framework QuickTime -framework CoreAudio -single_module -compatibility_version 1 -current_version 1 -o /Users/benb/Projects/Telestream/swRelease/Pipeline/2.6/Dib/Code/Macintosh/Frameworks/TSVideoAppKit/build/Release/TSVideoAppKit.framework/Versions/B/TSVideoAppKit
ld: framework not found TSPipelineEngine
collect2: ld returned 1 exit status
Command /Xcode3/usr/bin/g++-4.0 failed with exit code 1
Thanks for any help :)
So the problem was Xcode 3.2.6. If I down reved to 3.2.5 it worked. I have logged a bug against apple in their Radar system.
Problem ID: 10139645