cURL / Mailing Lists / curl-library / Single Mail


Re: Debugging Curl in xcode 4.5

From: Nick Zitzmann <>
Date: Fri, 12 Oct 2012 14:15:13 -0600

On Oct 2, 2012, at 1:03 PM, Michael Stowell <> wrote:

> Hi, yes I built my own, statically linked with debug enabled, and have ensured its the correct lib by adding it to the project using the absolute path to the lib I built

Okay, I tried this myself using libcurl 7.28 and Xcode 4.5.1 and got it to work. Here is what I did:

1. Configured curl using the --enable-debug option
2. Built curl using the resulting makefile
3. In the "other linker flags" build setting of the built product that uses libcurl, I included an absolute path to the built libcurl.a file as a linker flag, e.g. "/Users/yourusername/Downloads/curl-7.28.0/lib/.libs/libcurl.a" (you'll have to adjust that depending on your user name and where you placed the curl source code folder)
4. Added a symbolic breakpoint to a symbol internal to libcurl
5. Built and ran the Debug build of the product

After that, the breakpoint was hit and I was able to step through the libcurl source code just fine. Again, you need to make absolutely sure that your product is not accidentally being linked against OS X's libcurl, and the only way to tell is by using the otool command line tool.

Nick Zitzmann

List admin:
Received on 2012-10-12