Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6142693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:25:24+00:00 2026-05-23T18:25:24+00:00

I’m trying to compile a C project I’ve been working on on a remote

  • 0

I’m trying to compile a C project I’ve been working on on a remote server that runs OS X. The project depends, in part, on libcurl. I only have access to the machine through my administrator account remotely.

When I attempt to make the project I keep getting errors relating to libcurl functions and constants not being defined. I conclude that libcurl is not being properly included by the compiler.

I’m using fink to install opensource software for all the dependencies ( postgres, curl, a few others ) and all the dependencies appear to work except curl.

My compiler command looks like:

gcc -ggdb -ansi -Wall -D_GNU_SOURCE -L `/sw/bin/pg_config --libdir` `/sw/bin/curl-config --cflags` -I `/sw/bin/pg_config --includedir` -lpq -lcurl -lpthread -lm `/sw/bin/curl-config --libs` -c Client.c

If I make a test file like so:

/sw/bin/curl http://www.google.com/ --libcurl test.c

And then attempt to compile it with:

gcc test.c `/sw/bin/curl-config --cflags` `/sw/bin/curl-config --libs` -o test.o

It also fails. Can anyone help me shed some light on this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:25:25+00:00Added an answer on May 23, 2026 at 6:25 pm

    One compilation line is:

    gcc -ggdb -ansi -Wall -D_GNU_SOURCE -L `/sw/bin/pg_config --libdir` \
        `/sw/bin/curl-config --cflags` -I `/sw/bin/pg_config --includedir` \
        -lpq -lcurl -lpthread -lm `/sw/bin/curl-config --libs` -c Client.c
    

    This will take Client.c and generate Client.o, an object file. It doesn’t need the library information; there is no linking taking place because of the -c option.

    The other compilation line is:

    gcc test.c `/sw/bin/curl-config --cflags` `/sw/bin/curl-config --libs` -o test.o
    

    It is aconventional to end the names of executables with ‘.o‘; it leads to confusion. However, if test.c only references functions from the standard libraries and libcurl, it should ‘work’.

    On my Mac, there is a copy of curl-config in /usr/bin.


    Try this test program:

    $ cat curltest.c
    #include <stdio.h>
    #include <curl/curl.h>
    
    int main(void)
    {
        if (curl_global_init(0) == CURLE_OK)
        {
            printf("CURL version %s\n", curl_version());
            curl_global_cleanup();
        }
        else
            fprintf(stderr, "Failed to initialize CURL\n");
    
        return 0;
    }
    $ cc -o curltest $(curl-config --cflags) curltest.c $(curl-config --libs)
    $ file curltest
    curltest: Mach-O 64-bit executable x86_64
    $ otool -L curltest
    curltest:
        /usr/lib/libcurl.4.dylib (compatibility version 6.0.0, current version 6.1.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
    $ curltest
    CURL version libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
    $
    

    This is on MacOS X 10.6.8.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.