I am having problems with getting even a small sample program to link
against the IMAP c-client library on a RH71 system. (... and I'm feeling
like a total idiot -- what am I missing?!?)

The linker can not resolve the reference to mail_open(). The c-client
library is installed in a standard location (and readable):
-rw-r--r-- 1 root root 2404562 Apr 25 16:12 /usr/lib/libc-client.a

Here is the GCC invocation, and resultant messages:
$ gcc -lc-client -o simap simap.c
/tmp/ccgWddId.o: In function `main':
/tmp/ccgWddId.o(.text+0x3e): undefined reference to `mail_open'
collect2: ld returned 1 exit status

Here is the sample program:
--------- simap.c ----------------
#include <stdio.h>
#include <stdlib.h>
#include <imap/c-client.h>

main( int argc, char *argv[])
{
char *mbox_name;
long mbox_opts;
MAILSTREAM *istrm;

istrm = NIL;
mbox_name = "matrix.truedisk.com";
mbox_opts = OP_READONLY | OP_HALFOPEN;

printf( "Calling: mail_open( NIL, %s, %ld [0x%4x])\n",
mbox_name, mbox_opts, mbox_opts);
istrm = mail_open( istrm, mbox_name, mbox_opts);

if ( istrm == NIL ) {
fprintf( stderr, " -- failed.\n");
exit(1);
}
}
-------------------------------------

Any pointers would be greatly appreciated.

Thanks,
- Don Buchholz




--
-----------------------------------------------------------------
For information about this mailing list, and its archives, see: http://www.washington.edu/imap/imap-list.html
-----------------------------------------------------------------

Reply via email to