Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macmee

Suspended
Original poster
Dec 13, 2008
835
1,110
Canada
I downloaded libcurl and extracted it, and I see a lot of files like install-sh configure makefile reconf config.guess and so on. I just want to be able to open xcode, make a new c++ app, and be able to use #include <curl/curl.h> like the examples on the website. Can anyone show me how?:p

Sorry if this is a stupid question, but I'm just learning C++ and xcode for the first time!
 
If you've got Xcode installed then 'curl.h' is already available as expected. No need to install anything else.

Now if you go ahead and install a newer version of 'curl' someplace on the system other than over the existing version (which I don't recommend myself) you'll need to do some extra work to point to the newer headers.
 
If you've got Xcode installed then 'curl.h' is already available as expected. Not need to install anything else.

Now if you go ahead and install a newer version of 'curl' someplace on the system other than over the existing version (which I don't recommend myself) you'll need to do some extra work to point to the newer headers.

I just tried to do
HTML:
#include <string>  
#include <iostream>  
  #include <curl.h>


int main(int argc, char* argv[])  
{  return 0;
  }

and it can't find curl.h. There are some more things like curl which I want to use such as WxWidgets so I can create a GUI for my applications, but I'm not sure how to install these either:(
 

That works, thanks :).

Is there a tutorial for compiling these libraries? I'd like to install WxWidgets so I can create a GUI for my application.

edit: Ah, I'm getting linker errors:
Screen_shot_2009-11-03_at_10.21.02_PM-20091103-222114.png
 
Most likely it got installed into /usr/local/lib so you need to add the library into your Xcode project so it can link to it properly. Easiest way is to drag the file into the Frameworks group in Xcode.
 
Most likely it got installed into /usr/local/lib so you need to add the library into your Xcode project so it can link to it properly. Easiest way is to drag the file into the Frameworks group in Xcode.

I'm really new to XCode, but I can't find a folder called frameworks on the left side of my xcode project where it lists the folders.
 
I'm really new to XCode, but I can't find a folder called frameworks on the left side of my xcode project where it lists the folders.

Ah, my bad. That doesn't show up if you make a Command Line Tool project.

Try selecting in the menu bar Project > Add to Project. Then in the dialog, hit the keystroke Option-/ and in the window that shows type /usr/local/lib and hit Go. Then you can select the curl.a or whatever it's called to add to your project. Xcode should be smart enough to know what you selected and automatically link to it.
 
Ah, my bad. That doesn't show up if you make a Command Line Tool project.

Try selecting in the menu bar Project > Add to Project. Then in the dialog, hit the keystroke Option-/ and in the window that shows type /usr/local/lib and hit Go. Then you can select the curl.a or whatever it's called to add to your project. Xcode should be smart enough to know what you selected and automatically link to it.

Thanks, I didn't know about the option / thing, but there wasn't a curl.h in usr/local/lib
 
No, but there is 'libcurl.dylib' which is the library you need to link against to resolve your link errors.

The header itself is at '/usr/include/curl/curl.h'.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.