PDA

View Full Version : Tiger hoses C++ compatability


Dan Potter
2005.05.08, 03:53 PM
From the topic you probably think I'm talking about something else. :) It's true that GCC 4.0's C++ libraries won't link against a 3.3 (Panther) binary, and vice versa.. all well known stuff.

What's maybe not as well known is that a Tiger-compiled C++ app will not run at all on Panther. I've set my GCC to 3.3 at the command line, tried messing around with build settings, so on and so forth... but Tiger now links against several additional dylibs that were not present in Panther, even on a developer machine:

/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.3.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

Apparently both of these were only available statically linked in Panther. It's looking like I'll be stuck compiling the app on Panther to release it unless there's something I'm missing here... that or making it link the whole thing statically. What a faux paux!

Anyone have any other ideas for how to work around this? Or if I missed some setting somewhere... Maybe there's an Xcode setting to make it totally switch gears into Jaguar/Panther mode for things like this?

lightbringer
2005.05.08, 04:04 PM
What's maybe not as well known is that a Tiger-compiled C++ app will not run at all on Panther.

Correction, they will not work in anything below 10.3.9

Those extra libraries were included with the 10.3.9 update

Dan Potter
2005.05.08, 04:08 PM
Oh, did they include those in the 10.3.9 update? That'd be great.

Well, I really ought to rename this thread "Need a problem to solve itself? Post a question on iDevGames!" Because I exited Xcode, started it up again, and then did the old clean and rebuild for one more try, and it works now. I did all these same things a few minutes ago with no result. :mad: This is like the second time I've had this happen. I run into a weird problem, I post a question on here, and then it mysteriously fixes itself :wow:

Carlos, you're sitting on a gold mine here ;)

Maybe gcc_select doesn't take effect until you exit and restart Xcode or something?

OneSadCookie
2005.05.08, 04:47 PM
Just to make sure everything's clear in people's minds:

C++ applications built with GCC 4.0 will not work on versions of Mac OS X less than 10.3.9
C++ applications built with GCC 3.3 will work on all versions of Mac OS X
The OS on which you compile the application is irrelevant*

(OK, not quite true -- remember to use the appropriate SDK, etc)

iefan
2005.05.08, 04:48 PM
Maybe gcc_select doesn't take effect until you exit and restart Xcode or something?

Correct. Now I need my message to be long enough to not be ignored.

Dan Potter
2005.05.08, 08:29 PM
Great. Thanks for the pointers :)

mars
2005.06.12, 08:48 PM
Hi all,

what/where can I find gcc_select?

I've just discovered, to my mild horror, that my Tiger compiled app will not work in 10.3.8 or earlier. Not good. So I need to compile with a version of gcc < 4.0 it would seem...

Thanks.

mars
2005.06.12, 09:05 PM
OK, a googling found it. I expected it to be an Xcode preference, nestled in amongst all the myriad millions of other frightening options, but of course, that would be too simple wouldn't it? So, from the Terminal, this should do the trick:

sudo gcc_select 3.3

Compiling now, and crossing fingers.

OneSadCookie
2005.06.12, 09:17 PM
If you don't want to change your system compiler, you can also modify your build rules to use a different compiler just for the project.

mars
2005.06.12, 09:31 PM
Ah, thanks. Could you please elaborate on what I'd need to do this, exactly?

OneSadCookie
2005.06.12, 10:50 PM
in the build rules tab for your target, find the C files (system compiler) rule and attempt to edit it to use a specific version of gcc. You won't be allowed to, but it'll suggest duplicating it. Once duplicated, you can edit the copy (at the top of the list) to use the compiler you want.

mars
2005.06.13, 09:07 PM
Ok, thank for that.