linker error..

Matthijs Möhlmann matthijs at cacholong.nl
Tue Nov 26 05:56:49 EST 2013


Hello,

I have the following minimized sample program:
#include <iostream>

#include <cyrus/imclient.h>

int main(int argc, char **argv) {

    struct imclient *imclient;
    int rc = imclient_connect(&imclient, "localhost", "imap", nullptr);
    if (rc <0 ) {
        std::cerr << "error..." << std::endl;
    }

    return rc;
}

When I try to build the above I'll get:
matthijs at hammer:~/t$ g++ -std=c++11 -o main -lcyrus -lcyrus_min main.cpp
/tmp/ccqJI9xZ.o: In function `main':
main.cpp:(.text+0x26): undefined reference to
`imclient_connect(imclient**, char const*, char const*, sasl_callback*)'
collect2: error: ld returned 1 exit status

I am using debian and have installed cyrus-dev-2.4 (which has the static
libraries: (libcyrus.a and libcyrus_min.a))

Cyrus version: 2.4.17
GCC version: 4.8.1

Can somebody point me to a solution here? As I have no idea anymore how
to fix this...

Regards, Matthijs



More information about the Info-cyrus mailing list