• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Xcode-users] Linking static curl lib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xcode-users] Linking static curl lib


  • Subject: Re: [Xcode-users] Linking static curl lib
  • From: David Cohn <email@hidden>
  • Date: Tue, 25 Nov 2008 19:33:10 -0800


OK, here's my confusion: I made a simple test.c file which merely inits curl, prints the version, and terms curl. I copied libcurl.a to libtestcurl.a for testing:


[MacG5:/Chiri/contrib] davidcoh% ls -l
total 9576
-rw-r--r--   1 davidcoh  admin  2399712 Nov 22 17:49 libcurl.a
-rw-r--r--   1 davidcoh  admin  2399712 Nov 25 17:50 libtestcurl.a
-rw-r--r--   1 davidcoh  admin    96296 Nov 23 11:09 libz.a
-rw-r--r--   1 davidcoh  admin      878 Nov 25 19:15 test.c


This compiles and works perfectly, using the new library:

[MacG5:/Chiri/contrib] davidcoh% gcc test.c -o curltest -I/Chiri/ curl-7.18.1/include/curl -L/Chiri/contrib -ltestcurl -lz -lssl -lldap -lcrypto
[MacG5:/Chiri/contrib] davidcoh% curltest
curl version: 'libcurl/7.18.1 OpenSSL/0.9.7l zlib/1.2.3'



However, if I revert to the un-renamed lib, I still get the old library linked:


[MacG5:/Chiri/contrib] davidcoh% gcc test.c -o curltest -I/Chiri/ curl-7.18.1/include/curl -L/Chiri/contrib -lcurl -lz -lssl -lldap - lcrypto
[MacG5:/Chiri/contrib] davidcoh% curltest
curl version: 'libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3'



And specifying the path using "-l" doesn't work at all, although the file's definitely there:


[MacG5:/Chiri/contrib] davidcoh% gcc test.c -o curltest -I/Chiri/ curl-7.18.1/include/curl -L/Chiri/contrib -l/Chiri/contrib/ libtestcurl.a -lz -lssl -lldap -lcrypto
/usr/bin/ld: can't locate file for: -l/Chiri/contrib/libtestcurl.a
collect2: ld returned 1 exit status
[MacG5:/Chiri/contrib] davidcoh% ls -l /Chiri/contrib/libtestcurl.a
-rw-r--r-- 1 davidcoh admin 2399712 Nov 25 17:50 /Chiri/contrib/ libtestcurl.a



Drivin' me nuts! A donut for anyone who spots what I'm missing! Thanks, --Dave




On Nov 25, 2008, at 6:01 PM, Peter O'Gorman wrote:

David Cohn wrote:
Chirs,

Thanks for your help... something must be wrong here:

Other Linker Flags: -l/My/Full/Path/libcurl.a

Chris accidentally inserted the -l, just put /Full/Path/to/ libcurl.a in
Other Linker Flags.


Peter

_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: [Xcode-users] Linking static curl lib
      • From: Jason Stephenson <email@hidden>
References: 
 >Restore Build Results window to default? (From: Scott Squires <email@hidden>)
 >[Xcode-users] Linking static curl lib (From: David Cohn <email@hidden>)
 >Re: [Xcode-users] Linking static curl lib (From: Chris Espinosa <email@hidden>)
 >Re: [Xcode-users] Linking static curl lib (From: David Cohn <email@hidden>)
 >Re: [Xcode-users] Linking static curl lib (From: Peter O'Gorman <email@hidden>)

  • Prev by Date: Re: XCode and SSE4.1?
  • Next by Date: Re: [Xcode-users] Linking static curl lib
  • Previous by thread: Re: [Xcode-users] Linking static curl lib
  • Next by thread: Re: [Xcode-users] Linking static curl lib
  • Index(es):
    • Date
    • Thread