XAMPP 1.5.0 - libgd: undefined references

Irgendwelche Probleme mit XAMPP für Linux? Dann ist hier genau der richtige Ort um nachzufragen.

XAMPP 1.5.0 - libgd: undefined references

Postby AndreasKrohn » 11. January 2006 15:27

Hallo,

da ich den Webalizer auf deutsch einstellen wollte, musste ich ihn neu kompilieren. Dabei fiel mir auf das die mitgelieferte libgd anscheinend nicht korrekt gegen einige andere mitgelieferte Bibliotheken (libfreetype,libpng) gelinkt wurde.

Mit einem "ld /opt/lampp/lib/libgd.so.2.0.0" erhalte ich folgende Ausgabe:


Code: Select all
libgd.so.2.0.0: undefined reference to `longjmp'
libgd.so.2.0.0: undefined reference to `putchar'
libgd.so.2.0.0: undefined reference to `strcpy'
libgd.so.2.0.0: undefined reference to `uncompress'
libgd.so.2.0.0: undefined reference to `sqrt'
libgd.so.2.0.0: undefined reference to `printf'
libgd.so.2.0.0: undefined reference to `FT_Init_FreeType'
libgd.so.2.0.0: undefined reference to `jpeg_read_scanlines'
libgd.so.2.0.0: undefined reference to `jpeg_simple_progression'
libgd.so.2.0.0: undefined reference to `FT_Load_Glyph'
libgd.so.2.0.0: undefined reference to `FT_Done_Face'
libgd.so.2.0.0: undefined reference to `png_get_rowbytes'
libgd.so.2.0.0: undefined reference to `png_set_strip_16'
libgd.so.2.0.0: undefined reference to `getenv'
libgd.so.2.0.0: undefined reference to `floor'
libgd.so.2.0.0: undefined reference to `png_create_read_struct'
libgd.so.2.0.0: undefined reference to `qsort'
libgd.so.2.0.0: undefined reference to `fgets'
libgd.so.2.0.0: undefined reference to `FT_Get_Kerning'
libgd.so.2.0.0: undefined reference to `FT_Get_Char_Index'
libgd.so.2.0.0: undefined reference to `png_set_sig_bytes'
libgd.so.2.0.0: undefined reference to `memcpy'
libgd.so.2.0.0: undefined reference to `jpeg_set_defaults'
libgd.so.2.0.0: undefined reference to `malloc'
libgd.so.2.0.0: undefined reference to `png_set_read_fn'
libgd.so.2.0.0: undefined reference to `png_set_packing'
libgd.so.2.0.0: undefined reference to `FT_Get_Glyph'
libgd.so.2.0.0: undefined reference to `png_get_io_ptr'
libgd.so.2.0.0: undefined reference to `fflush'
libgd.so.2.0.0: undefined reference to `jpeg_start_decompress'
libgd.so.2.0.0: undefined reference to `jpeg_destroy'
libgd.so.2.0.0: undefined reference to `png_set_IHDR'
libgd.so.2.0.0: undefined reference to `jpeg_write_marker'
libgd.so.2.0.0: undefined reference to `png_set_tRNS'
libgd.so.2.0.0: undefined reference to `calloc'
libgd.so.2.0.0: undefined reference to `FT_Glyph_To_Bitmap'
libgd.so.2.0.0: undefined reference to `fprintf'
libgd.so.2.0.0: undefined reference to `png_get_valid'
libgd.so.2.0.0: undefined reference to `strcat'
libgd.so.2.0.0: undefined reference to `jpeg_destroy_decompress'
libgd.so.2.0.0: undefined reference to `jpeg_std_error'
libgd.so.2.0.0: undefined reference to `jpeg_CreateDecompress'
libgd.so.2.0.0: undefined reference to `fseek'
libgd.so.2.0.0: undefined reference to `png_create_write_struct'
libgd.so.2.0.0: undefined reference to `cos'
libgd.so.2.0.0: undefined reference to `png_get_error_ptr'
libgd.so.2.0.0: undefined reference to `sin'
libgd.so.2.0.0: undefined reference to `atan2'
libgd.so.2.0.0: undefined reference to `strncmp'
libgd.so.2.0.0: undefined reference to `png_write_info'
libgd.so.2.0.0: undefined reference to `png_set_PLTE'
libgd.so.2.0.0: undefined reference to `realloc'
libgd.so.2.0.0: undefined reference to `FT_Set_Char_Size'
libgd.so.2.0.0: undefined reference to `_IO_getc'
libgd.so.2.0.0: undefined reference to `strtok'
libgd.so.2.0.0: undefined reference to `sscanf'
libgd.so.2.0.0: undefined reference to `fread'
libgd.so.2.0.0: undefined reference to `png_get_PLTE'
libgd.so.2.0.0: undefined reference to `strdup'
libgd.so.2.0.0: undefined reference to `fopen'
libgd.so.2.0.0: undefined reference to `memset'
libgd.so.2.0.0: undefined reference to `ftell'
libgd.so.2.0.0: undefined reference to `jpeg_read_header'
libgd.so.2.0.0: undefined reference to `jpeg_start_compress'
libgd.so.2.0.0: undefined reference to `fclose'
libgd.so.2.0.0: undefined reference to `png_write_end'
libgd.so.2.0.0: undefined reference to `jpeg_destroy_compress'
libgd.so.2.0.0: undefined reference to `png_get_IHDR'
libgd.so.2.0.0: undefined reference to `png_set_write_fn'
libgd.so.2.0.0: undefined reference to `jpeg_finish_decompress'
libgd.so.2.0.0: undefined reference to `jpeg_resync_to_restart'
libgd.so.2.0.0: undefined reference to `strcmp'
libgd.so.2.0.0: undefined reference to `jpeg_CreateCompress'
libgd.so.2.0.0: undefined reference to `sprintf'
libgd.so.2.0.0: undefined reference to `FT_Done_Glyph'
libgd.so.2.0.0: undefined reference to `stderr'
libgd.so.2.0.0: undefined reference to `png_read_info'
libgd.so.2.0.0: undefined reference to `FT_Glyph_Get_CBox'
libgd.so.2.0.0: undefined reference to `jpeg_finish_compress'
libgd.so.2.0.0: undefined reference to `png_destroy_read_struct'
libgd.so.2.0.0: undefined reference to `fwrite'
libgd.so.2.0.0: undefined reference to `png_check_sig'
libgd.so.2.0.0: undefined reference to `access'
libgd.so.2.0.0: undefined reference to `png_write_image'
libgd.so.2.0.0: undefined reference to `png_read_update_info'
libgd.so.2.0.0: undefined reference to `png_read_image'
libgd.so.2.0.0: undefined reference to `png_get_tRNS'
libgd.so.2.0.0: undefined reference to `__errno_location'
libgd.so.2.0.0: undefined reference to `exit'
libgd.so.2.0.0: undefined reference to `FT_New_Face'
libgd.so.2.0.0: undefined reference to `png_create_info_struct'
libgd.so.2.0.0: undefined reference to `atoi'
libgd.so.2.0.0: undefined reference to `_IO_putc'
libgd.so.2.0.0: undefined reference to `compress'
libgd.so.2.0.0: undefined reference to `_setjmp'
libgd.so.2.0.0: undefined reference to `jpeg_set_quality'
libgd.so.2.0.0: undefined reference to `FT_Glyph_Transform'
libgd.so.2.0.0: undefined reference to `strlen'
libgd.so.2.0.0: undefined reference to `jpeg_write_scanlines'
libgd.so.2.0.0: undefined reference to `png_destroy_write_struct'
libgd.so.2.0.0: undefined reference to `strchr'
libgd.so.2.0.0: undefined reference to `vfprintf'
libgd.so.2.0.0: undefined reference to `free'
libgd.so.2.0.0: undefined reference to `png_read_end'
AndreasKrohn
 
Posts: 7
Joined: 09. November 2005 15:57

Postby Oswald » 13. January 2006 13:36

Hallo Andreas!

Beim Linken des Webalizers musst Du nur die fehlenden Libraries mit angeben. Das ist eigentlich alles.

Liebe Grüße
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Postby AndreasKrohn » 16. January 2006 11:45

Hallo, ich habs probiert, aber es klappt leider nicht.
Meine conf sieht so aus:
Code: Select all
#!/bin/sh
#CPPFLAGS="-nostdinc" CFLAGS="-nostdlib"

./configure --prefix=/opt/lampp --with-etcdir=/opt/lampp/etc --with-language=german --libdir=/opt/lampp/lib --includedir=/opt/lampp/include \
--with-gdlib=/opt/lampp/lib --with-gd=/opt/lampp/include \
--with-zlib=/opt/lampp/lib --with-z-inc=/opt/lampp/include \
--with-png=/opt/lampp/lib --with-png-inc=/opt/lampp/include


Und das make endet so:

Code: Select all
cc -I/opt/lampp/include -I/opt/lampp/include -I/opt/lampp/include -Wall -O2 -DETCDIR=\"/opt/lampp/etc\"  -DHAVE_GETOPT_H=1 -DHAVE_MATH_H=1   -c webalizer.c
gcc -I/opt/lampp/include -I/opt/lampp/include -I/opt/lampp/include -Wall -O2 -DETCDIR=\"/opt/lampp/etc\"  -DHAVE_GETOPT_H=1 -DHAVE_MATH_H=1   -c hashtab.c
gcc -I/opt/lampp/include -I/opt/lampp/include -I/opt/lampp/include -Wall -O2 -DETCDIR=\"/opt/lampp/etc\"  -DHAVE_GETOPT_H=1 -DHAVE_MATH_H=1   -c linklist.c
gcc -I/opt/lampp/include -I/opt/lampp/include -I/opt/lampp/include -Wall -O2 -DETCDIR=\"/opt/lampp/etc\"  -DHAVE_GETOPT_H=1 -DHAVE_MATH_H=1   -c preserve.c
gcc -I/opt/lampp/include -I/opt/lampp/include -I/opt/lampp/include -Wall -O2 -DETCDIR=\"/opt/lampp/etc\"  -DHAVE_GETOPT_H=1 -DHAVE_MATH_H=1   -c dns_resolv.c
gcc -I/opt/lampp/include -I/opt/lampp/include -I/opt/lampp/include -Wall -O2 -DETCDIR=\"/opt/lampp/etc\"  -DHAVE_GETOPT_H=1 -DHAVE_MATH_H=1   -c parser.c
gcc -I/opt/lampp/include -I/opt/lampp/include -I/opt/lampp/include -Wall -O2 -DETCDIR=\"/opt/lampp/etc\"  -DHAVE_GETOPT_H=1 -DHAVE_MATH_H=1   -c output.c
gcc -I/opt/lampp/include -I/opt/lampp/include -I/opt/lampp/include -Wall -O2 -DETCDIR=\"/opt/lampp/etc\"  -DHAVE_GETOPT_H=1 -DHAVE_MATH_H=1   -I/opt/lampp/include -c graphs.c
gcc -L/opt/lampp/lib -L/opt/lampp/lib -L/opt/lampp/lib  -o webalizer webalizer.o hashtab.o linklist.o preserve.o parser.o output.o dns_resolv.o graphs.o -lgd -lpng -lz -lm
/opt/lampp/lib/libgd.so: undefined reference to `FT_Init_FreeType'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_read_scanlines'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_simple_progression'
/opt/lampp/lib/libgd.so: undefined reference to `FT_Load_Glyph'
/opt/lampp/lib/libgd.so: undefined reference to `FT_Done_Face'
/opt/lampp/lib/libgd.so: undefined reference to `FT_Get_Kerning'
/opt/lampp/lib/libgd.so: undefined reference to `FT_Get_Char_Index'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_set_defaults'
/opt/lampp/lib/libgd.so: undefined reference to `FT_Get_Glyph'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_start_decompress'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_destroy'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_write_marker'
/opt/lampp/lib/libgd.so: undefined reference to `FT_Glyph_To_Bitmap'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_destroy_decompress'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_std_error'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_CreateDecompress'
/opt/lampp/lib/libgd.so: undefined reference to `FT_Set_Char_Size'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_read_header'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_start_compress'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_destroy_compress'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_finish_decompress'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_resync_to_restart'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_CreateCompress'
/opt/lampp/lib/libgd.so: undefined reference to `FT_Done_Glyph'
/opt/lampp/lib/libgd.so: undefined reference to `FT_Glyph_Get_CBox'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_finish_compress'
/opt/lampp/lib/libgd.so: undefined reference to `FT_New_Face'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_set_quality'
/opt/lampp/lib/libgd.so: undefined reference to `FT_Glyph_Transform'
/opt/lampp/lib/libgd.so: undefined reference to `jpeg_write_scanlines'
collect2: ld returned 1 exit status
make: *** [webalizer] Fehler 1


Ich weiß leider nicht weiter wie ich die Libraries angeben soll.

P.S. Ist es denn normal das auch ein "ld libgd.so.2.0.0." diese Fehlermeldungen ausgibt?
AndreasKrohn
 
Posts: 7
Joined: 09. November 2005 15:57

Postby Oswald » 16. January 2006 12:09

Hallo Andreas!

Kopier dir einfach mal folgende Zeile und ruf sie im Webalizer-Source-Directory auf (also da wo Du auch make usw. aufgerufen hast):

Code: Select all
gcc -L/opt/lampp/lib -L/opt/lampp/lib -L/opt/lampp/lib  -o webalizer webalizer.o hashtab.o linklist.o preserve.o parser.o output.o dns_resolv.o graphs.o -lgd -lpng -lz -lm -lfreetype -ljpeg -ldb


Ich hab am Ende der Zeile einfach noch -lfreetype -ljpeg -ldb hinzugefügt.

AndreasKrohn wrote:P.S. Ist es denn normal das auch ein "ld libgd.so.2.0.0." diese Fehlermeldungen ausgibt?


Jepp. Libgd weiß nicht, dass die anderen Libraries existieren und vermisst die "fehlenden" Funktionen. Aber meinst Du wirklich ld oder wolltest Du eher ldd sagen?

Liebe Grüße
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Postby AndreasKrohn » 16. January 2006 13:19

Danke, das hat geklappt!

Obwohl es mich wundert, das der Linker diese Bibliotheken nicht von selbst findet, da ich doch den Library-Pfad /opt/lampp/lib angegeben hab.

---

Ich meine "ld", bei der Suse-eigenen libgd gibt es diese Fehlermeldungen nicht, auch nicht bei andern Libs aus /opt/lampp/lib.

Mein Problem war ursprünglich, das ich einen selbstkompilierten Webalizer nicht per php aufrufen konnte, ohne das eine Fehlermeldung bezüglich libgd und fehlender Referenz zu einer jpeg-Funktion erfolgte.

Daraufhin stieß ich dann auf die undefined references in der libgd unter /opt/lampp/lib.

---

Nochmals danke :)
AndreasKrohn
 
Posts: 7
Joined: 09. November 2005 15:57


Return to XAMPP für Linux

Who is online

Users browsing this forum: No registered users and 2 guests