Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
I have finished my installer and it works perfectly on the Intel Mac (OS X 10.4 and 10.5) however there is a good number of people that wish to use my code on the PowerPC, I know the compiled code will not work on the PowerPC since it was compiled on the Intel. How do I convert it so that it will or make it universal?
 

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
I am compiling it in Xcode by using the build button, is there a setting that will help with this?
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,566
I am compiling it in Xcode by using the build button, is there a setting that will help with this?

In "Targets", click on the target for the shipping application, "Get Info". Choose the "Release" configuration (you probably don't want PowerPC for debugging), then under "Architectures" enter "ppc i386".

For testing you _should_ have a PowerPC Mac. If you don't, change "Architectures" to "ppc" only. This will build only ppc code which will then run under Rosetta. This should find most bugs. The biggest compatibility problem is usually using fread and fwrite to read or write structs to a file - PowerPC and x86 have different byte ordering, so this will create files that are not compatible. Obviously you'll want to switch back to "ppc i386" once you're done testing.
 

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
I have changed the top part to ppc it had already said i386 ppc. When I compiled it and then tried it on a ppc 10.4 it did not work. Didnt even show up on the screen with an error anything. It is a cocoa program and uses popen and pclose. Did I miss something?
 

sord

macrumors 6502
Jun 16, 2004
352
0
Did you build a Debug version or a Release version?

An app built as debug won't work on another machine.
 

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
Update. I have tried everything that I can think of to compile it as PPC. It is an intel mac OS X 10.5 and Xcode 3.0. I dont want to redo the code all over again from scratch. How do I get this thing complete?
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Have you checked the console when you try to run it on a PPC machine to see if there are any messages being printed there?

If the program is actually crashing, invoking it from the command-line with GDB instead of clicking the app bundle might tell you where it's dying.

What version(s) of OS X are on the PPC machines you are testing? Are they also 10.4 or 10.5?

-Lee
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
Are you building with the correct SDK version for the Mac OS X version running on the PPC machine? If you are compiling against the 10.5 SDK it won't work at all if the PPC machine is running 10.4.

Plus don't forget things like garbage collection are not available if you are using Tiger.
 

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
If I compile it as 10.4 will it work on 10.5, 10.4, and 10.3? And do I need to bump it down from Xcode 3.0 to 2.4?
 

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
Ok at least I am getting somewhere. I had to change a few things in the code to get the version checker working as 10.4 doesn't seem to have the NSAppKitVersionNumber10_4 so I changed it to 10_3 how I have another error I can't even find on the net.

it is a error on linking the project and it gives me the following error msg:

"_objec_enumeration", referenced from:

How do I solve that?
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
Ok at least I am getting somewhere. I had to change a few things in the code to get the version checker working as 10.4 doesn't seem to have the NSAppKitVersionNumber10_4 so I changed it to 10_3 how I have another error I can't even find on the net.

it is a error on linking the project and it gives me the following error msg:

"_objec_enumeration", referenced from:

How do I solve that?

Are you using Objective-C 2.0? If so Mac OS X 10.4 only supports Objective-C 1.0, remove everything like fast enumeration and the like to get it to work.
 

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
so I would have to set all the value Hardcoded in instead of having like

Array = {a, b, c, d};

Where Array is a NSMutableArray and a throu d are objects, of course the array is properly allocated in the code, I just threw something here to have an understanding.
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
so I would have to set all the value Hardcoded in instead of having like

Array = {a, b, c, d};

Where Array is a NSMutableArray and a throu d are objects, of course the array is properly allocated in the code, I just threw something here to have an understanding.

Nah, if you wrote your code to use the new Objective-C features found in Leopard, it will most likely be incompatible with Tiger. Make sure you are using the old style if you want your programs to work. I'm not great at Objective-C so can't give you any hard and fast examples unfortunately.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.