[fpc-devel] error when linking

Michael Van Canneyt michael at freepascal.org
Wed May 25 23:32:56 CEST 2005

On Wed, 25 May 2005, Linuxer Wang wrote:

> Hi, all
> I try to compile my program with chmlib.
> There're chmlib.so and chmlib.a under /usr/lib. I find a wierd problem,
> when I compile my program, the compiler uses chmlib.so, and the
> compilation is successful.
> But what I want is too compile it with chmlib.a so that the executable
> will be independent with chmlib.so. So I delete the chmlib.so and the
> compiler try to compile with chmlib.a, the following errors occur:
> /usr/local/lib/libchm.a(chm_lib.o)(.text+0x3b1): In function
> `chm_set_param':
> src/chm_lib.c:1034: undefined reference to `__moddi3'
> /usr/local/lib/libchm.a(chm_lib.o)(.text+0xba6): In function
> `_chm_decompress_block':
> src/chm_lib.c:1387: undefined reference to `__umoddi3'
> /usr/local/lib/libchm.a(chm_lib.o)(.text+0xd4b):src/chm_lib.c:1454:
> undefined reference to `__umoddi3'
> /usr/local/lib/libchm.a(chm_lib.o)(.text+0xf86): In function
> `chm_retrieve_object':
> src/chm_lib.c:1500: undefined reference to `__udivdi3'
> /usr/local/lib/libchm.a(chm_lib.o)(.text+0xf9c):src/chm_lib.c:1501:
> undefined reference to `__umoddi3'
> /usr/local/lib/libchm.a(chm_lib.o)(.text+0xff8):src/chm_lib.c:1509:
> undefined reference to `__umoddi3'
> Error: Error while linking
> Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not
> specifiy a source file to be compiled)
> So interesting, the same program compiled with different libs gives
> different results.
> Can anyone give me some sugguestion? Thanks in advance.

Try linking with libm.a and also check for the libgcc.a library.


More information about the fpc-devel mailing list