Setting up SFML 1.6 with Xcode 4 - xcode4

After searching the internet for a guide on setting up SFML 1.6 with Xcode 4, i havent come across anything. I know that you cant use templates of SFML 1.6 with xcode 4. Can anyone point me in the right direction?

ok, took me 5 days of fiddling to fix but it worked:
followed everything in this guide : http://www.sfml-dev.org/tutorials/1.6/start-osx.php
put sfml frameworks in /usr/local/lib/ VERY IMPORTANT
downloaded xcode 3 dmg and installed in seperate location.
made project from templates
opened project in xcode 4 - doesn't compile
went to Project -> build settings -> Framework Search Paths = /usr/local/lib
Xcode should compile fine now :)

Related

How to open project files with Xcode 4 by default while having Xcode 5 installed alongside

Xcode 4 is still my main IDE for iOS development. To try the upcoming iOS 7 I installed Xcode 5 Developer Preview and now all the files that were used to open in Xcode 4 now open in Xcode 5.
How can I revert Xcode 4 to be default editor again without uninstalling Xcode 5?
After reading about LaunchServices in OS X I have finally found the solution, thanks for the hint #peter-m.
To modify files association for certain app one can use lsregister tool. So to re-register the app there is -f parameter, and to unregister -u. Everything can be in fact done with just one command:
$ lsregister -f /Applications/Xcode.app
Or if you want to unregister Xcode 5 and not touch manually set associations earlier:
$ lsregister -u /Applications/Xcode5-DP5.app
lsregister is located in /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/, so add it to your $PATH
Re-login to OS X for changes to apply.
Assuming you don't have any Xcode 5 projects yet, how about manually:
Find an existing XCode 4 project (*.xcodeproj) with the Finder
Do a Get Info of the file
Change Open with: to your desired version of Xcode
Click on Change All
Repeat for all types of files that you want to open with XCode 4
Or if you want to try something more automatic take a look at: programmatically-script-atically-changing-the-default-open-with-setting
Based on the comment below, the problem seems to be with command line builds picking the wrong version of Xcode. In that case I suggest looking at: xcode-build-and-archive-from-command-line, especially the Reid's comment to his own answer which says:
Works fine in Xcode 4.4, and I'm sure it was fine in 4.3 as well. Make sure you have selected the correct Xcode release by using:
xcode-select <path to Xcode.app>
So perhaps the correct solution is based around understanding:
xcode-select -- Manages the path to the Xcode folder for Xcode BSD tools.

How to run and use Xcode 3 and Xcode 4 under OS X 10.7 Lion?

I am looking for a full guide on how to trick Xcode3 to run under Lion.
I am aware that Apple does not support this, but this doesn't meant it's impossible, it's just not supported.
This is how I upgraded my dev environment to Lion. I am only doing it this way because I'm in a crunch and have some issues with Xcode 4.
I'm just sharing what I did and the issues I encountered, not recommending anything:
I made sure I could build & launch my Apps in 10.6.8 using Xcode 3.2.x.
I upgraded my development machine to Lion 10.7.1.
I can build all my SW products with Xcode 3.2.x.
BUT, the debugger seems unhappy with some things... Though I can step and break, I can't evaluate some expressions. For example, the twist pane won't display contents of complex structures.
I'm wondering if others have debugger issues with the 3.2.x Xcode (GDB) on Lion?
Thanks,
Rick
First you have to obtain the Xcode 3.2.6 install to work. The installer is not going to work on Lion so you have two alternatives:
Run it from another partition where you have 10.6
Path the installer in order to make it run on Lion by following this guide
Also here are some other things you may have to clean inside the xcode projects:
Remove lines like ARCHS = arm7 because it will fail to build for Simulator. Best is to let Xcode use defaults (all supported archs).
Check for SDKROOT = ..., it should be only iphoneos, macosx or undefined (not ""). Keep in mind that the SDK you are building against is not necessary the minimum required SDK for running the application. It's ok if SDKROOT is missing from Xcode project files but it's not ok if it does contain a path or "".
Remove any GCC_VERSION = ...

How do I specify an installation location for Xcode 4.1 from the Mac App Store?

I just installed Lion, and downloaded Xcode 4.1 from the Mac App Store. I like having my Xcodes installed in /Developer directories that have their Xcode versions appended (e.g. /Developer-xcode3.2.6). Downloading Xcode 4.1 from the Mac App Store just gives me an installer app, which does not allow me to specify an installation location, as Xcode installers did in the past. When I ran the installer, it asked me to move old Xcode 3 installs out of /Developer, so is just renaming the /Developer directory sufficient? Will that break stuff?
Locate the 'Xcode Install' package. Show package contents. Inside the Resources folder you will find Xcode.mpkg. Install as usual.
renaming the folder should be enough but, yes, it may break stuff if you continue to use xcode 3. “it may” because you will still have a “/Developer” folder which will contain tools xcode use. if they (the tools) don't change too much between xc3 & 4, you shouldn't have any problem.
but stick with xcode4 and you won't have any problem at all.

How do I force install XCode 4.1 from the app store?

the app store botched its installation of Xcode 4.1 (it turned claimed it was 4.0 but the app store claimed 4.1 was installed). So I deleted the /Developer folder thinking this would let me reinstall a clean Xcode 4.1.
The app store still thinks Xcode 4.1 is installed and will not download or reinstall any version of Xcode. How do I force install Xcode 4.1?
Just to explain further...
The App Store download had actually worked
What you saw when you looked at Xcode was your old install, because you had not yet run the installer at that point.
Just find the "XCode installer" in your applications folder and run that to complete the install.
It caught me out too.
Do you have the application "Install Xcode" in your /Applications folder. That worked for me.
Deleting the Install Xcode app works for me - after that I have the opportunity to download that monster all over again
To make a clean installation of Xcode first completely uninstall the previous Xcode version:
From a Terminal window type:
$ sudo /Developer/Library/uninstall-devtools --mode=all
That process may take a while!
Then try your installation again.

Xcode 4 (final version) error when building

I can't seem to find the answer.
I've just used Xcode 4 final version and built an existing project that was built ok with Xcode 3, but got this error:
ld: library not found for -lSystem.B
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
But another project was built OK with Xcode 4.
I installed Xcode 4 by choosing the default options.
Do I miss to include a library or framework somewhere?
Could somebody please help. Thank you.
Here's my solution for Xcode 4.0.2 with SDK 4.3 environment, but I believe it should also work on other setups.
libSystem.B.dylib is not present
under
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib,
however it is present for lower SDK
versions (e.g. iPhoneOS4.2.sdk)
most of the cases
libSystem.B.dylib is just a
symbolic link to libSystem.dylib
so in
iPhoneSimulator4.3.sdk/usr/lib
I've applied following command sudo
ln -s libSystem.dylib
libSystem.B.dylib and my simulator
builds started to work again :)
NOTE: libSystem.B.dylib is used by Flurry and Urban Airship so you better don't delete the reference in project file (of course Urban Airship does not work under Simulator, but I think Flurry does. libSystem.B.dylib may also be required by other libraries you included to your project.
UPDATE: solution still works for iOS5 Simulator after upgrading to Xcode 4.3
UPDATE, March 9th, 2k12: for Xcode installations via App Store, prefix above path with /Applications/Xcode.app/Contents or the path where you've installed Xcode.app.
Solved.
Turns out that there was a reference to libSystemB in my project (Don't know why it's there). After deleting the reference, it built well.
Thanks anyway guys!
-weak_library /usr/lib/libSystem.B.dylib breaks the iOS Simulator.
Use -weak-lSystem instead.
The quote belongs to gparker on the official dev forums.
-weak_library /usr/lib/libSystem.B.dylib breaks the iOS Simulator. Use -weak-lSystem instead.
nicktmro got it right, especially when you are developing cocos2d projects using xcode 4.x
I have the same problem since months and always kept making the symbolic link as described here everytime i updated xCode. Today I found a nice new way to fix this:
In your targets Build Phases go to 'Link Binary With Libraries' and search for:
libz.dylib
Set from 'Required' to 'Optional'
BUILD
BE HAPPY

Resources