List Info

Thread: Problems using rfc822 and rfc2045 libraries




Problems using rfc822 and rfc2045 libraries
country flaguser name
United Kingdom
2007-02-26 07:16:45
Hi,

I'm looking at using the maildrop libraries for an
application I'm working
on, and have a few problems getting a basic test working.
When I compile,
I get the following errors:
$ gcc -o mdtest -lrfc822 -lrfc2045 mdtest.c
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc822.so:
undefined
reference to `unicode_convert_fromchset'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc2045.so:
undefined
reference to `libmail_str_pid_t'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc2045.so:
undefined
reference to `libmail_str_time_t'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc822.so:
undefined
reference to `unicode_ISO8859_1'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc822.so:
undefined
reference to `unicode_xconvert'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc2045.so:
undefined
reference to `libmail_str_size_t'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc2045.so:
undefined
reference to `rfc2045_error'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc822.so:
undefined
reference to `unicode_find'
collect2: ld returned 1 exit status

I downloaded maildrop.2.0.3 onto a CentOS 4.4 system
(2.6.9-42.EL kernel),
unpacked and compiled with:
./configure --with-devel
make
make install-strip
make install-man

I later added a 'make install' for good measure.

The first problem I saw was including rfc2045.h:
/usr/local/include/rfc2045.h:12:57:
../rfc2045/rfc2045_config.h: No such
file or  directory

I edited /usr/local/include/rfc2045.h to point to this
file:
#include       
"/usr/local/src/maildrop-2.0.3/rfc2045/rfc2045_config.h
"
/* VPATH build */

The source code is as follows:
#include <stdio.h>
#include <rfc822.h>
#include <rfc2047.h>
#include <rfc2045.h>

int main(int argc, char *argv) {
        printf("Hello Worldn");
}

I've checked for the symbols it can not find, and all appear
to be in the
rfc2047 source. It appears as if rfc2047 has not been
included in the
library.

Has anyone else had the same problem or know what could be
causing this?

Dave


-- 



-- 


------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Courier-maildrop mailing list
Courier-maildroplists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courie
r-maildrop

Re: Problems using rfc822 and rfc2045 libraries
country flaguser name
United States
2007-02-26 17:15:52
Dave Hartburn writes:

> Hi,
> 
> I'm looking at using the maildrop libraries for an
application I'm working
> on, and have a few problems getting a basic test
working. When I compile,
> I get the following errors:
> $ gcc -o mdtest -lrfc822 -lrfc2045 mdtest.c
>
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc822.so:
undefined
> reference to `unicode_convert_fromchset'

You also need to link with libunicode, in the unicode
subdirectory.



------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Courier-maildrop mailing list
Courier-maildroplists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courie
r-maildrop

Re: Problems using rfc822 and rfc2045 libraries
country flaguser name
United Kingdom
2007-02-27 04:05:01
No joy I'm afraid. I've tried copying libunicode.a and
libunicode.la to
/usr/local/lib, then compiling with -lunicode.

I have also tried pointing directly at that directory:
$ gcc -o mdtest
-L/usr/local/src/maildrop-2.0.3/unicode/.libs -lunicode
-lrfc2045 -lrfc822 mdtest.c
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc822.so:
undefined
reference to `unicode_convert_fromchset'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc2045.so:
undefined
reference to `libmail_str_pid_t'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc2045.so:
undefined
reference to `libmail_str_time_t'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc822.so:
undefined
reference to `unicode_ISO8859_1'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc822.so:
undefined
reference to `unicode_xconvert'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc2045.so:
undefined
reference to `libmail_str_size_t'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc2045.so:
undefined
reference to `rfc2045_error'
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc822.so:
undefined
reference to `unicode_find'

Any other suggestions?

Dave



> Dave Hartburn writes:
>
>> Hi,
>>
>> I'm looking at using the maildrop libraries for an
application I'm
>> working
>> on, and have a few problems getting a basic test
working. When I
>> compile,
>> I get the following errors:
>> $ gcc -o mdtest -lrfc822 -lrfc2045 mdtest.c
>>
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc822.so:
undefined
>> reference to `unicode_convert_fromchset'
>
> You also need to link with libunicode, in the unicode
subdirectory.
>
>
>
------------------------------------------------------------
-------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the
chance to share
> your
> opinions on IT & business topics through brief
surveys-and earn cash
> http://www.techsay.com/default.php?page=join
.php&p=sourceforge&CID=DEVDEV_______________________
________________________
> Courier-maildrop mailing list
> Courier-maildroplists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/courie
r-maildrop
>


-- 


------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Courier-maildrop mailing list
Courier-maildroplists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courie
r-maildrop

Re: Problems using rfc822 and rfc2045 libraries
country flaguser name
United States
2007-02-27 06:06:45
David Hartburn writes:

> 
> No joy I'm afraid. I've tried copying libunicode.a and
libunicode.la to
> /usr/local/lib, then compiling with -lunicode. I have
also tried pointing
> directly at that directory:
> $ gcc -o mdtest
-L/usr/local/src/maildrop-2.0.3/unicode/.libs -lunicode
> -lrfc2045 -lrfc822 mdtest.c
>
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../librfc822.so:
undefined
> reference to `unicode_convert_fromchset'

If you built these as shared libraries, libunicode should
also be built as a 
shared library.

> Any other suggestions?

Yes.  You need to undertstand the differences between static
and shared 
libraries, and how they work.  This is not something that
can be 
explained in one or two sentences.  Read the man pages.

First of all, I don't see how you got librfc822, and others,
built as shared 
libraries. Maildrop's default makefile always builds them as
static 
libraries.  You must've hacked the makefile to do that. 
Well, since that 
would be your hacks, the old saying goes: you break it, you
get to pick up 
the pieces.


------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Courier-maildrop mailing list
Courier-maildroplists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courie
r-maildrop

Re: Problems using rfc822 and rfc2045 libraries
country flaguser name
United Kingdom
2007-02-27 08:05:18
> First of all, I don't see how you got librfc822, and
others, built as
> shared
> libraries. Maildrop's default makefile always builds
them as static
> libraries.  You must've hacked the makefile to do that.
 Well, since that
> would be your hacks, the old saying goes: you break it,
you get to pick up
> the pieces.
>

No hacking, this appears to be the default. Incase it was
something odd on
CentOS, I've tried it on an Ubuntu system, just doing:
Download and unpack maildrop-2.0.3
./configure --with-devel
make
make install-strip
make install-man

as per the instructions. Both systems produce shared libs
without any
modifications at all.

I will see if I can build libunicode shared and see what
happens.

Dave


------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Courier-maildrop mailing list
Courier-maildroplists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courie
r-maildrop

Re: Problems using rfc822 and rfc2045 libraries
country flaguser name
United States
2007-02-27 17:19:50
Dave Hartburn writes:

> 
>> First of all, I don't see how you got librfc822,
and others, built as
>> shared
>> libraries. Maildrop's default makefile always
builds them as static
>> libraries.  You must've hacked the makefile to do
that.  Well, since that
>> would be your hacks, the old saying goes: you break
it, you get to pick up
>> the pieces.
>>
> 
> No hacking, this appears to be the default. Incase it
was something odd on
> CentOS, I've tried it on an Ubuntu system, just doing:
> Download and unpack maildrop-2.0.3
> ./configure --with-devel
> make
> make install-strip
> make install-man
> 
> as per the instructions. Both systems produce shared
libs without any
> modifications at all.

I find that rather odd.  Something must get triggered in
libtool for those 
distribution only -- it does not happen on Fedora.

Do you have the libtool package installed?  That is,
libtool, libtool-ltld, 
and libtool-ltdl-devel packages?

> I will see if I can build libunicode shared and see
what happens.

No.  It should be the other way around.



------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Courier-maildrop mailing list
Courier-maildroplists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courie
r-maildrop

Re: Problems using rfc822 and rfc2045 libraries
country flaguser name
United Kingdom
2007-02-28 04:28:38
Hi,

Thanks for all your help, I now have things compiling. There
were two
issues, libtool was indeed telling gcc to produce shared
libraries, and
the --disable-shared flag is required when calling
configure.

The second one was my stupidity. The error was complaining
about shared
libraries in /usr/lib, not /usr/local/lib, which is where I
was installing
to. /usr/lib was from one of my failed attempts to use a
maildrop-devel
RPM. Sorry about that, should have spotted it sooner.

It still needed a little tweaking, the full procedure is
below. Is this
worth putting in the FAQ for CentOS/RedHat distributions? If
so, do you
want me to check it out on my Ubuntu distro too?

wget http://prdownloads.sourceforge.net/courier/mail
drop-2.0.3.tar.bz2
bunzip2 maildrop-2.0.3.tar.bz2
tar -xvf maildrop-2.0.3.tar
cd maildrop-2.0.3
./configure --with-devel --disable-shared
make
make install-strip
make install-man
cp rfc2045/rfc2045_config.h /usr/local/include
vi /usr/local/include/rfc2045.h
	< #include       
"../rfc2045/rfc2045_config.h" /* VPATH build */
	> #include       
"/usr/local/include/rfc2045_config.h" /* VPATH
build */


Write some basic code (mdtest.c):
#include <stdio.h>
#include <rfc822.h>
#include <rfc2047.h>
#include <rfc2045.h>

int main(int argc, char *argv) {
	printf("Hello World!n");

}


Compile:
$ gcc -o mdtest -lrfc822 -lrfc2045 mdtest.c
$ ./mdtest
Hello World!

Start writing mail handling code......

Thanks again

Dave


> I find that rather odd.  Something must get triggered
in libtool for those
> distribution only -- it does not happen on Fedora.
>
> Do you have the libtool package installed?  That is,
libtool,
> libtool-ltld,
> and libtool-ltdl-devel packages?
>
>> I will see if I can build libunicode shared and see
what happens.
>
> No.  It should be the other way around.
>

------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Courier-maildrop mailing list
Courier-maildroplists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courie
r-maildrop

[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )