How to force the use of static libs when the dylib is present?
Okay, now this is just frustrating.
I'm trying to use libcurl for a project I'm working on but I want it to link to the latest version of libcurl I built myself. However, Mac OSX comes with dylibs to an older version of libcurl, which apparently, XCode will link to over the static libs. After some scouring of the forums, it seems the only solution is to rename the dylibs so that XCode can't find them and then use the static version instead.
So my question now is, has anyone figured out a way around this without renaming the dylib? Besides using XCode, that is.
I'm trying to use libcurl for a project I'm working on but I want it to link to the latest version of libcurl I built myself. However, Mac OSX comes with dylibs to an older version of libcurl, which apparently, XCode will link to over the static libs. After some scouring of the forums, it seems the only solution is to rename the dylibs so that XCode can't find them and then use the static version instead. So my question now is, has anyone figured out a way around this without renaming the dylib? Besides using XCode, that is.
The brains and fingers behind Malarkey Software (plus caretaker of the world's two brattiest felines).
Pass the full absolute path to the .a file to the linker. Use the "extra linker flags" or whatever it's called. Don't add the library to your Xcode project.
Okay, that seemed to do the trick for release builds but not debug ones. Ah well, good enough. The debug builds can use the dylibs. 
Edit: Or not... Sheesh. Once I renamed the dylibs back to their original names, it started linking to them again. Okay, time to do some more poking around. This is what I'm passing under "Other Linker Flags": -l/Users/vtagle/libcurl/lib/libcurl.a

Edit: Or not... Sheesh. Once I renamed the dylibs back to their original names, it started linking to them again. Okay, time to do some more poking around. This is what I'm passing under "Other Linker Flags": -l/Users/vtagle/libcurl/lib/libcurl.a
The brains and fingers behind Malarkey Software (plus caretaker of the world's two brattiest felines).
drop the -l
Oh... Okay. Yeah, that did the trick. Thanks!
For the record, if you're trying to statically link libcurl, you'll also need to link to libssl and libcrypto (from the openssl package).
For the record, if you're trying to statically link libcurl, you'll also need to link to libssl and libcrypto (from the openssl package).
The brains and fingers behind Malarkey Software (plus caretaker of the world's two brattiest felines).
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Dylib problem | ugriffin | 2 | 3,574 |
Apr 20, 2011 05:28 PM Last Post: ugriffin |
|
| Cocoa fundamentals - the message loop in a dylib | bumperman | 5 | 5,088 |
Nov 8, 2009 11:17 AM Last Post: OneSadCookie |
|
| XCode doesn't realize a library has changed unless you force your project to build. | XSTNX | 6 | 4,954 |
Jun 8, 2009 10:25 AM Last Post: XSTNX |
|
| how to debug a dylib? | sakiel | 1 | 3,387 |
Aug 16, 2007 07:26 PM Last Post: OneSadCookie |
|
| Linking to dylib in xCode | Jones | 6 | 4,702 |
Jun 26, 2006 02:08 PM Last Post: OneSadCookie |
|

