Skip to content

static link with libmicrohttpd issue #2

Description

@devsunny

Hi Richard,

I am trying to compile and static link with libmicrohttpd. with the following command, I am getting "undefined reference to" error, If I compile without -static flag, it works perfectly. did I do anything wrong? the test.c is just a copy of one of example, I add #include stdlib.h, stdio and string.h.

gcc -static -DHAVE_CONFIG_H -ggdb -std=gnu99 -o test -I/opt/bigdatalab/usrlib/libmicrohttpd/include/ -L /opt/bigdatalab/usrlib/libmicrohttpd/lib -lmicrohttpd test.c -lrt

/tmp/ccaFAFRr.o: In function answer_to_connection': test.c:27: undefined reference toMHD_lookup_connection_value'
test.c:31: undefined reference to MHD_create_response_from_buffer' test.c:39: undefined reference toMHD_queue_response'
test.c:41: undefined reference to MHD_queue_response' test.c:43: undefined reference toMHD_destroy_response'
/tmp/ccaFAFRr.o: In function main': test.c:62: undefined reference toMHD_start_daemon'
test.c:69: undefined reference to `MHD_stop_daemon'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions