Blitz Max not working with new Lion/Xcode

Archives Forums/BlitzMax Bug Reports/Blitz Max not working with new Lion/Xcode

Oddball(Posted 2012) [#1]
Have you ever had a week where everything you tried to do failed? I'm having one of those. Anyway, I have a brand new version of Lion 10.7.3, not an upgrade, a brand new install of Xcode 4.3, again not an upgrade, and a brand new install of BlitzMax 1.46. When I attempt to build modules I get the following output -
Building Modules
Compiling:blitz_app.c
sh: gcc: command not found
Build Error: failed to compile /Applications/BlitzMax/mod/brl.mod/blitz.mod/blitz_app.c
Process complete

What am I doing wrong?

Last edited 2012


Oddball(Posted 2012) [#2]
Ok, apparently Xcode doesn't ship with gcc anymore. I had to run the Xcode app and from the menu select Preferences>Downloads>Components>Command Line Tools>Install. This removed the above error, but now I get the following errors when I build modules.

Surely BlitzMax has been tested on an out-of-the-box Lion/Xcode setup before?! What am I doing wrong?

Last edited 2012


Oddball(Posted 2012) [#3]
I've tested with fresh installs of BlitzMax v1.43, 1.44, 145, and 1.46 all with the same error. I'm guessing it has something to do with Lion/Xcode 4.3. If I try to build an app without building the modules I get -
Building fireworks
Compiling:fireworks.bmx
Linking:fireworks.debug
ld: library not found for -lcrt1.o
collect2: ld returned 1 exit status
Build Error: Failed to link /Applications/BlitzMax/samples/simonh/fireworks/fireworks.debug.app/Contents/MacOS/fireworks.debug
Process complete



jkrankie(Posted 2012) [#4]
http://tech.chickenandporn.com/2011/10/28/xcode-4-2-gcc-cannot-find-lcrt1-10-6-0-o/

Cheers
Charlie


Oddball(Posted 2012) [#5]
In the end I installed Xcode 4.2.1 and everything worked first time. I've wasted too much time on this already so gonna leave it at that.


ima747(Posted 2012) [#6]
I believe the problem is as of 4.3 XCode now includes all the compiler tools internally. There is a seperate package to install the command line tools but this doesn't seem to connect up with the right SDK (I think blitzmax needs the 10.6 sdk which seems to be dropped in 4.3+). The command line tools say that you can use compiler commands included in Xcode itself from the command line in a round about way which presumably blitzmax should be updated for otherwise new mac users are going to be totally boned... I suspect this still doesn't resolve the possible SDK issue however...


ima747(Posted 2012) [#7]
Here's how I got bmax working under lion, post Xcode 4.3 from my other thread on the subject reposted here in the hopes it will be useful to someone in need.


I got it working. It's a bit of a cluster-explitive but here's the skinny:

Assuming you're running lion, need to use Xcode 4.3.1 (assuming you're doing iOS dev otherwise probably easier to just not use it for now...) and need to use BlitzMax (you're on the forum so that's a pretty safe assumption).

1) Install Xcode 4.3.1 from the app store. Run it, configure it, make sure it's working.
2) Go to Apple Developer Downloads and download Xcode 4.2.1 installer.
3) Install Xcode from the 4.2.1 installer disc.
4) Here's where it gets silly... that installer you just installed? that installed an app called "Xcode Installer" in your applications folder... Run THAT and it will actually install Xcode 4.2.1.
5) Run BlitzMax and ensure things are compiling (YAY! BlitzMax works)
6) Run Xcode 4.3.1, it may require you to install some iOS connection tools again because 4.2.1 overwrote them with older version. This is JUST iOS stuff, it won't break blitzmax.
7) Clean house. Remove Xcode 4.2.1 from your dock so you don't accidentally get it confused with 4.3.1. Delete the Xcode installer app from your applications folder (it's huge, why waste the space). Toss the Xcode installer-installer disc image.
9) Boggle at the concept of a disc image with an installer that installs an app thats an installer to install what the disc image should have installed.




Oddball(Posted 2012) [#8]
This is fixed for me in BlitzMax v1.47 so you can bug bin this thread.