PDA

View Full Version : Link problem


DaveF
2006.08.04, 09:31 AM
Hi,

I'm fairly sure this is something to do with zerolink, although I'm not sure how to fix it. Here's the problem:

1. Do File->New Project...->Carbon C++ Application
2. Add in the framework AGL
3. In main add #include <AGL/agl.h> and in MainWindow::Create() add the function aglResetLibrary()
4. Build on debug - works
5. Build on release (with zerolink off as is the default) - fails

Can someone tell me how to fix release builds? :mad:

OneSadCookie
2006.08.04, 10:00 AM
What error does it give?

DaveF
2006.08.04, 10:15 AM
What error does it give?

That it can't find the symbol aglResetLibrary(). I'm fairly sure it's something to do with zerolink since if I turn that off, I don't get the error. But then, by the same token, I don't get a proper link either :(

Try the steps above, they are what I have (simplified) to repeat the problem.

I'm using XCode 2.3 if that's of any use.

Fenris
2006.08.04, 10:30 AM
Odd, that works for me... Builds and runs just fine?

DaveF
2006.08.04, 10:39 AM
Hmm odd. Can you tell me what you did? In particular, how did you add your framework? I've only just started using xcode so may not be doing things 100% correctly.

I clicked over the "Link binary with libraries" and "Add Existing Framework..."

Somehow my libraries aren't getting linked properly on a release build :\

DaveF
2006.08.04, 11:57 AM
I've noticed the same problem can be encountered on debug builds too, by disabling Build->Allow Zerolink :wacko:

DaveF
2006.08.04, 03:40 PM
Hello again

I realise I'm probably talking to myself by now ;) ... but I fixed it.. The problem was my release build was trying to compile for a ppc architechture, but oddly was trying to link against a different architecture in the SDK 3.9 frameworks.. I still cannot remove this damn reference though.

When you add frameworks do you usually just add /system/library/frameworks... ?

Fenris
2006.08.04, 11:07 PM
Ah, right. Most setups link the x86 builds with the 10.4 Universal SDK, and the PPC with the 10.3.9 SDK for maximun compatibility.

When I add frameworks, I right-click the Frameworks group and choose "Add existing framework".