I'm using XCode 3.2.6. I'd like to make my game work for earlier version 3.1.3 but when I build the Project in Xcode, I'm getting the following error:
File /Users/.../build/Debug-iphoneos/libcocos2d libraries.a depends on itself. This target might include its own product.
And it's the only error. What's the meaning of this error? What's the issue here?
For some reason your Cocos2d library depends on itself. Open the properties for your Cocos2d library target (right click -> "Get Info") and look at the general tab. There's a list called "DirectDependencies". Remove the cocos2d library from that list.
Another place where a direct dependency could occur is the Cocos2d library product. Open the properties for your Cocos2d library product (this time under "Products" not under "Targets"). Open the targets tab and look at the targets. If the cocos2d library is checked as target, uncheck it.
Related
I download Core ML model files from Apple's web page but my mac and XCode don't recognise them. Here is what I see when I add them to my project navigator:
What am I doing wrong?
I had this problem and noticed that XCode 9 Beta 4 has a bug in which every time you drag a mlmodel to your project it does not get added to the target even though you selected your target to add.
The solution is to click the file and tick the "Add to target" box located in the utilities tab. (XCode's right panel)
I want to use a graph in my iPhone app. I have downloaded the source code Core- Plot for it, but now when I am trying to run it I am getting an error.
clang: error: -Z-reserved-lib-stdc++: 'linker' input unused when '-c' is present
Can anyone suggest me what this error mean or how to resolve it.
`iPhone, iPod Touch, and/or iPad Application
Dependent Project Install
Because frameworks cannot be used in Cocoa Touch applications in the same way as on the Mac, the means of including Core Plot within an iPhone application are slightly different.
First, drag the CorePlot-CocoaTouch.xcodeproj file into your iPhone application's Xcode project. Show the project navigator in the left-hand list and click on your project.
Select your application target from under the "Targets" source list that appears. Click on the "Build Phases" tab and expand the "Target Dependencies" group. Click on the plus button, select the CorePlot-CocoaTouch library, and click Add. This should ensure that the Core Plot library will be built with your application.
Core Plot is built as a static library for iPhone, so you'll need to drag the libCorePlot-CocoaTouch.a static library from under the CorePlot-CocoaTouch.xcodeproj group to the "Link Binaries With Libraries" group within the application target's "Build Phases" group you were just in.
You'll also need to point to the right header location. Under your Build settings, set the Header Search Paths to the relative path from your application to the framework/ subdirectory within the Core Plot source tree. Make sure to make this header search path recursive. You need to add -ObjC to Other Linker Flags as well (as of Xcode 4.2, -all_load does not seem to be needed, but it may be required for older Xcode versions).
Core Plot is based on Core Animation, so if you haven't already, add the QuartzCore framework to your application project.
Finally, you should be able to import all of the Core Plot classes and data types by inserting the following line in the appropriate source files within your project:
import "CorePlot-CocoaTouch.h"`
Source: core plot wiki on google
I got a solution for it here is the link.
CorePlot failed to build in XCode 4.4
Basically the issue was related to Xcode.
I'm working in a project that need to have same parts native (cocoa touch) and some parts in cocos2d. I have made the all the native and now I need to integrate cocos2d in the project. My problem is that i cant add with success the cocos2d library to my project.
Any good solution to do that? I'm using xCode 4
You essentially have two choices.
Option 1: Add cocos2d files to your existing project
Add cocos2d files to your project as normal (drag the source files in, copy to dest folder).
Create an EAGLView in a View Controller and bind it to the CCDirector. (See an example project for reference.
Option 2: Install your existing code into a fresh project using the cocos2d templates
The latest version of cocos2d (1.0-RC) has XCode 4 templates. Install them:
install-templates.sh --force
Then create a new cocos2d project using those templates in XCode 4. Add your existing files and update the project that it creates, and you should be good to go.
Personally, I've had better luck with Option #2, but most of my code is pretty easy to move around.
Once you have downloaded the Cocos2d version from the link above, you need to open 'terminal' and drag the install-templates.sh file into the terminal window.
Everyone kept saying "drag the directory into terminal then type the above" but it comes back saying 'is a directory'. I searched for ages to do this and found this answer.
Once you have dragged the install-templates.sh file from the Cocos2d directory, hit return and it installs the Cocos2d templates to your Xcode directory.
Then you can open a project in Xcode and it has the templates ready for you.
Is it possible to have an Xcode project file which contains both the Cocoa (MacOSX) and CocoaTouch (iPhone) versions of a component?
I thought I was getting close until I realized that you need to set "Base SDK for All Configurations" in the Project Settings in order for the cross-compiler to be called (and for any CocoaTouch frameworks to be found and properly handled by Xcode).
Since that is a project-wide setting, I don't know how I can have both MacOSX and iPhoneOS targets in the same project file.
Specifying:
SDKROOT = iphoneos3.0
in an xcconfig file (used by iPhone-only targets) did not seem to work.
Yes, you can, but there are some glitches.
Okay first off, you can override any Base SDK in several ways. One is that you can on the gear at the bottom of the inspector and "Add Build Setting Condition" which lets you conditionalize any build settings based on things like the target architecture, etc.
Second, even if you have a project wide setting, it can been overriden per target. So if you have seperate targets you can just add an SDKROOT to the to the various targets with their SDKROOT.
Third, the SDK selected in the popup in your Xcode window overrides evertyhing else. So if you have something besides "Base SDK" in that popup it will get used. Also, if you do switch that (lets say from "Base SDK" to "iPhone Simulator") and then you switch targets to a target that does not support the currently selected SDK it will appear to deselect, but it doesn't actually correctly autorevert the Base SDK, you need to reselect it in the pop up.
I still can't consistently get multiple archs building together properly as part of an aggregate (for instance, having an OS X target that preprocesses some resource built so that it can be used as a build phase in a later target building an iPhone app).
No biggie, but when I add the AVFoundation framework for the iPhone, it turns red for some reason I'm unable to figure out why. The project will not compile unless I add this framework, and if I do, Xcode will mark the framework red (apparently that means xcode cannot find the framework), but yet it will work.
This is quite annoying. Any clue what I might be doing wrong here?
Try adding AVFoundation framework via your target.
Look for your target under "Groups and Files"
"Get Info" for it
Click the "General" tab
At the bottom right of the window click the "+" button
At the top of your list you should find AVFoundation, add it.
close Xcode
delete your project
shut down your mac
take the mac back to your boss and tell him it's not working
wait until they figure out what it is
if this doesn't work, find a new job that doesn't require the use of a mac
All I had to do was open up the "General" settings tab for the project and change the "Base SDK for All Configurations" value. It was set to an SDK that I no longer had installed.