Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > weak link a name with spaces? (CW)

weak link a name with spaces? (CW)
Thread Tools
raccoong
Fresh-Faced Recruit
Join Date: Jun 2006
Status: Offline
Reply With Quote
Apr 5, 2006, 09:44 PM
 
I need to weak link a framework whose name has a space in it.

In CodeWarrior you can weak link with a .lcf file that includes the line:
-weak_framework TheFrameworkName

But now I've been sent a framework (third-party so I can't just rename it) that has a space in it. Namely: dcampi Library.

I've tried enclosing the name in both single and double quotes, but they are ignored and I always get an error about "Library" being an unknown command.

Does anyone know if this can be worked around?

Thanks,
John
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 5, 2006, 10:04 PM
 
I don't have CodeWarrior, but have you tried shell escaping (i.e., either "dcampi\ Library" or "dcampi\\ Library")?
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
raccoong  (op)
Fresh-Faced Recruit
Join Date: Jun 2006
Status: Offline
Reply With Quote
Apr 5, 2006, 11:31 PM
 
Originally Posted by Chuckit
I don't have CodeWarrior, but have you tried shell escaping (i.e., either "dcampi\ Library" or "dcampi\\ Library")?
Good suggestion, I hadn't thought of that, but it didn't work.

I also tried escaping the quotes around the name, but no joy.

I also tried dcamapi\0x20Library, but it just took it literally and said it couldn't find dcamapi\0x20Library.

Hmmm, I don't see any other framework on my system with a space in the name. I think it may have to be renamed. The developer sent me an XCode sample project, but I get an error in the console opening it ("Failed to load file", gee thanks). So I can't see what they are doing there.

Oh well, back at it tomorrow. Thanks again.
     
Detrius
Professional Poster
Join Date: Apr 2001
Location: Asheville, NC
Status: Offline
Reply With Quote
Apr 6, 2006, 09:43 PM
 
Okay... your original post is about 10% ambiguous... you're using CodeWarrior, right? Why not Xcode?
ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
raccoong  (op)
Fresh-Faced Recruit
Join Date: Jun 2006
Status: Offline
Reply With Quote
Apr 6, 2006, 10:47 PM
 
Originally Posted by Detrius
Okay... your original post is about 10% ambiguous... you're using CodeWarrior, right? Why not Xcode?
Well, because I'm using CodeWarrior. I've got over 40 projects to move to XCode, and right now this one's still in CW.

But, if I _were_ using XCode, how would I mark an entire framework to be weak linked? I've searched the XCode 2.2.1 help and not found anything that matches this CW option. But I'm probably just not familiar enough with XCode. Where should I look for this?
     
Detrius
Professional Poster
Join Date: Apr 2001
Location: Asheville, NC
Status: Offline
Reply With Quote
Apr 7, 2006, 08:35 PM
 
Originally Posted by JMacV8
Well, because I'm using CodeWarrior. I've got over 40 projects to move to XCode, and right now this one's still in CW.

But, if I _were_ using XCode, how would I mark an entire framework to be weak linked? I've searched the XCode 2.2.1 help and not found anything that matches this CW option. But I'm probably just not familiar enough with XCode. Where should I look for this?

It's in the gcc man page. In your LDFLAGS, you would put something along these lines:

-weak_framework dcampi\ Library

You can also link individual functions weakly, though I don't have the info readily available.


Also, I find this excessively handy for doing research on gcc:

alias pman "man -t \!:* | open -f -a Preview"

It opens the man page as a postscript document in preview. Then, you can take advantage of the search capabilities of Preview to find features you need, which is pretty important, since the gcc man page is freaking huge.
ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
raccoong  (op)
Fresh-Faced Recruit
Join Date: Jun 2006
Status: Offline
Reply With Quote
Apr 7, 2006, 10:22 PM
 
Originally Posted by Detrius
It's in the gcc man page. In your LDFLAGS, you would put something along these lines:

-weak_framework dcampi\ Library
OK, got it. The CW .lcf file is a dead-end, there's no way to quote or escape that space.

You can also link individual functions weakly, though I don't have the info readily available.
You append "__attribute__((weak_import))" to the declaration (in XCode).

Thanks for the tip on running the man page into Preview, that will be useful as I move to XCode.
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:59 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,