I'm currently trying to build an app with Cocos2D and Theos but without success.
I have a Jailbroken iPhone 4S (iOS 7.0.4) with :
SDK 7.0
Clang
LLVM
LD64
but do not have a Mac.
When I run the make command, it prints a lot of errors :
Making all for application TestCocos2D...
Copying resource directories into the application wrapper...
Linking application TestCocos2D...
Undefined symbols for architecture armv7:
"_CCNextPOT", referenced from:
-[CCLabelTTF createTextureWithAttributedString:useFullColor:] in CCLabelTTF.m.bd6d7c66.o
-[CCLabelTTF createTextureWithString:useFullColor:] in CCLabelTTF.m.bd6d7c66.o
-[CCRenderTexture initWithWidth:height:pixelFormat:depthStencilFormat:] in CCRenderTexture.m.bd6d7c66.o
...........
"_kmMat4PerspectiveProjection", referenced from:
-[CCDirectorIOS setProjection:] in CCDirectorIOS.m.bd6d7c66.o
"_kmVec3Fill", referenced from:
-[CCDirectorIOS setProjection:] in CCDirectorIOS.m.bd6d7c66.o
"_kmVec3TransformCoord", referenced from:
-[CCDirector convertToGL:] in CCDirector.m.bd6d7c66.o
-[CCDirector convertToUI:] in CCDirector.m.bd6d7c66.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [obj/TestCocos2D.app/TestCocos2D.64873355.unsigned] Error 1
make[1]: *** [internal-application-all_] Error 2
make: *** [TestCocos2D.all.application.variables] Error 2
Makefile :
export TARGET = iphone:clang
export TARGET_SDK_VERSION = 7.0
export TARGET_IPHONEOS_DEPLOYMENT_VERSION = 7.0
export ARCHS = armv7
include theos/makefiles/common.mk
APPLICATION_NAME = TestCocos2D
TestCocos2D_FILES = Libraries/cocos2d/Platforms/iOS/CCAppDelegate.m Libraries/cocos2d/Platforms/iOS/CCDirectorIOS.m Libraries/cocos2d/Platforms/iOS/CCES2Renderer.m Libraries/cocos2d/Platforms/iOS/CCGLView.m Libraries/cocos2d/Platforms/iOS/UITouch+CC.m Libraries/cocos2d/CCAction.m Libraries/cocos2d/CCActionCatmullRom.m .... Libraries/cocos2d/cocos2d.m main.m Classes/AppDelegate.m Classes/HelloWorldScene.m Classes/IntroScene.m
TestCocos2D_FRAMEWORKS = UIKit CoreGraphics
include $(THEOS_MAKE_PATH)/application.mk
Folder :
control
makefile
main.m
Classes
AppDelegate.h
HelloWorldScene.h
IntroScene.h
AppDelegate.c
HelloWorldScene.c
IntroScene.c
Libraries
link to cocos2d
link to cocos2d-ui
link to kazmath
link to ObjectAL
Newton
Ressources
Link to theos
So, how could I solve those issues ?
What should resemble the makefile and the directory ?
Is there a way to create a Framwork and use it as UIKit or CoreGraphics in the makefile ?
Thanks a lot in advance.
Related
I'm trying to make a single view application for iOS and tvOS with MobileVLCKit.
I downloaded files from git.
I ran ./buildMobileVLCKit.sh with -f key and got a framework ("MobileVLCKit.framework" folder containing MobileVLCKit binaty and Headers subfolder).
I temporary put the framework into ~/Desktop/FrameworkFolder/
I created new project in XCode, chose "File->Add files" and located the framework.
Added Framework Search Path in Project Options (~/Desktop/FrameworkFolder/, recursive).
Added #import into ViewController.h file.
Added VLCMediaPlayer *vPlayer = [[VLCMediaPlayer alloc] init]; into ViewController.m -> viewDidLoad method.
This is my binary:
imac:~ vlad$ file ~/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit
/Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit: Mach-O universal binary with 5 architectures
/Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit (for architecture armv7): current ar archive random library
/Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit (for architecture armv7s): current ar archive random library
/Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit (for architecture i386): current ar archive random library
/Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit (for architecture x86_64): current ar archive random library
/Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit (for architecture arm64): current ar archive random library
When I try to build and run the project I'm getting two types of errors:
If I'm working with AppleTV project:
ld: in /Users/vlad/Desktop/FrameworkFolder/MobileVLCKit.framework/MobileVLCKit(VLCMediaPlayer.o), building for tvOS, but linking in object file built for iOS, for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I'm working with iOS project:
Undefined symbols for architecture x86_64:
"_AVAudioSessionCategoryPlayback", referenced from:
_Start in MobileVLCKit(audiounit_ios.o)
_Pause in MobileVLCKit(audiounit_ios.o)
"_AVAudioSessionModeMoviePlayback", referenced from:
_Start in MobileVLCKit(audiounit_ios.o)
_Pause in MobileVLCKit(audiounit_ios.o)
"_AudioComponentFindNext", referenced from:
_Start in MobileVLCKit(audiounit_ios.o)
"_AudioComponentInstanceDispose", referenced from:
_Stop in MobileVLCKit(audiounit_ios.o)
— at the begining, and:
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Showing first 200 notices only
— at the end of output. And 155 critical errors between.
I have tried to use precompilled framework as well, same result.
The questions are:
What am I doing wrong?
How can I solve this issue and successfully
build and run the project(s)?
Thank you for any help!
The reason of ld and clang errors was that the Framework and the Library has been built wrong.
The reason of multiple errors during working with iOS project is that required system frameworks has not been included.
I built the static library using XCode and the issue has been solved!
I am trying to package a Jailbreak Tweak using Theos on Windows 8.1 (64bit). If I do not specify Arm64 it compiles fine and works on my iPhone 5. However not my 6s. The console says a big error which I don't understand. Any help trying to get this tweak to compile with 64bit architecture would be great.
Makefile:
ARCHS = armv7 armv7s arm64
test_FRAMEWORKS = UIKit
include theos/makefiles/common.mk
TWEAK_NAME = Forton
Forton_FILES = Tweak.xm
include $(THEOS_MAKE_PATH)/tweak.mk
SUBPROJECTS += fortonprefs
include $(THEOS_MAKE_PATH)/aggregate.mk
Error Log:
$ make package
/home/AbbottL/forton/theos/makefiles/targets/Cygwin/iphone.mk:38: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Making all for tweak Forton...
Linking tweak Forton...
ld: warning: ignoring file /home/AbbottL/forton/theos/sdks/iPhoneOS8.1.sdk/usr/lib/dylib1.o, missing required architecture arm64 in file /home/AbbottL/forton/theos/sdks/iPhoneOS8.1.sdk/usr/lib/dylib1.o (2 slices)
ld: warning: ignoring file /home/AbbottL/forton/theos/lib/libsubstrate.dylib, file was built for armv7 which is not the architecture being linked (arm64): /home/AbbottL/forton/theos/lib/libsubstrate.dylib
Undefined symbols for architecture arm64:
"_MSHookMessageEx", referenced from:
_logosLocalInit() in Tweak.xm.91812798.o
ld: symbol(s) not found for architecture arm64
armv7-apple-darwin11-clang: error: linker command failed with exit code 1 (use -v to see invocation)
/home/AbbottL/forton/theos/makefiles/instance/library.mk:27: recipe for target 'obj/Forton.dylib.1b5b9d6a.unsigned' failed
make[2]: *** [obj/Forton.dylib.1b5b9d6a.unsigned] Error 1
/home/AbbottL/forton/theos/makefiles/instance/library.mk:19: recipe for target 'internal-library-all_' failed
make[1]: *** [internal-library-all_] Error 2
/home/AbbottL/forton/theos/makefiles/master/rules.mk:54: recipe for target 'Forton.all.tweak.variables' failed
make: *** [Forton.all.tweak.variables] Error 2
Using ios 8.1 SDK
Fixed by swapping libsustrate file to a later version.
I am using Xcode 6.1 with iOS 8.1 SDK to develop an iOS application.
SailracerEngine class imports SmoothSpeedTimeSeries and SmoothCourseTimeSeries classes to implement some of its functionality. Both are subclasses of SmoothTimeSeries. When I try to build my project, linker fails with the following error:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_SmoothCourseTimeSeries", referenced from:
objc-class-ref in SailracerEngine.o
"_OBJC_CLASS_$_SmoothSpeedTimeSeries", referenced from:
objc-class-ref in SailracerEngine.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Other module in my code is using SmoothSpeedTimeSeries and SmoothCourseTimeSeries without any linker errors. How can this issue be solved?
The implementation file for class SmoothCourseTimeSeries has not been added to the Xcode Target.
If you click on the implementation file you should be able to see which Xcode targets it belongs to using the file inspector on the right.
I'm building a trigger.io native module and included the AFNetworking 2.0 framework by manually adding the header and implementation files into the ForgeModule project.
AFNetworking 2.0 indicates a target requirement of ios 6.0+.
In xcode, i've changed the deployment target for the UniversalForgeModule to 6.0.
Yet after including this newly packaged native module in my app, I get the following error upon building it:
Ld build/Release-iphonesimulator/ForgeInspector.app/Forge normal i386
cd /var/folders/xw/34h86n3d5p54qpq1wfc8ff600000b1/T/tmp5z_JZJ/ios/app
setenv IPHONEOS_DEPLOYMENT_TARGET 5.0.1
...
Undefined symbols for architecture i386:
_UTTypeCopyPreferredTagWithClass", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in frisbees.a(AFURLRequestSerialization.o)
"_UTTypeCreatePreferredIdentifierForTag", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in frisbees.a(AFURLRequestSerialization.o)
"_kUTTagClassFilenameExtension", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in frisbees.a(AFURLRequestSerialization.o)
"_kUTTagClassMIMEType", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in frisbees.a(AFURLRequestSerialization.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/Release-iphonesimulator/ForgeInspector.app/Forge normal i386
(1 failure)
Looks like my build target is still 5.0.1. How do I go about changing that?
Full logs available here.
Thanks!
It seems AFNetworking 2.0 is referencing the Apple Framework: MobileCoreServices.framework.
To include Apple frameworks to your module, you will need to Change build configuration by adding an add_ios_system_framework build step.
Steps:
Add a build_steps.json file to the ios folder within your module directory.
Add the following to the file:
[
{
"do": {
"add_ios_system_framework": {
"framework": "MobileCoreServices.framework"
}
}
}
]
Update your inspector project, so that the newly added build step is applied to your project.
i am trying to add this mpos.framework to my Static library but i get this :
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MPMpos", referenced from:
objc-class-ref in libSerenity.a(Widget.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
i should add the mpos.framework to the DependentApp also?
i should add the mpos.framework to the DependentApp also? - You can easily answer this by trying it.
My guess is that this is not your problem. It looks like mpos.framework (and its internal library) is not FAT library and is compiled for ARM architecture(s) only. It probably do not contain i386 (simulator) version of the compiled code. You can find more information about FAT libraries here: Build fat static library (device + simulator) using Xcode and SDK 4+