Hi zusammen !
Ich habe ein c++ Programm geschrieben, welches sich auch fehlerfrei
übersetzen lässt. (gcc png.cpp -lgd)
-------------------------snip---------------------
/* Bring in gd library functions */
#include
/* Bring in standard I/O so we can output the PNG to a file */
#include
#include
#include
#include
#include
#include
#include
int main() {
/* Declare the image */
gdImagePtr im;
/* Declare output files */
FILE *pngout, *jpegout;
/* Declare color indexes */
int black;
int white;
int red;
char *s="Hallo Martin";
im = gdImageCreate(500, 500);
white = gdImageColorAllocate(im, 255, 255, 255);
red = gdImageColorAllocate(im, 255, 0, 0);
black = gdImageColorAllocate(im, 0, 0, 0);
gdImageFilledRectangle(im,0,0,450,450,red);
// ############################
// Hier ist das Problem !!
//gdImageString(im, gdFontLarge, 0, 0, s, white);
// #############################
pngout = fopen("test.png", "wb");
/* Output the image to the disk file in PNG format. */
gdImagePng(im, pngout);
/* Close the files. */
fclose(pngout);
/* Destroy the image in memory. */
gdImageDestroy(im);
}
-----------------snap-----------------------------
Kommentiere ich die Zeile "gdImageString(im, gdFontLarge, 0, 0, s,
white);" ein, erhalte ich den Fehler:
png2.cpp: In function `int main()':
png2.cpp:29: passing `char *' as argument 5 of
`gdImageString(gdImage *, gdFont *, int, int, unsigned char *,
int)' changes signedness
Vom Syntax her ist alles korrekt.
Ich habe mir mal den Sourcecode von webalizer angeschaut, die
nutzen es genauso ... *versteh ich nicht*
Kann mir jemand was zu der Fehlermeldung sagen ??
Ich bin für jeden Tipp dankbar.
Ich nutze gdlib-1.8.4, SuSE 7.3
Mfg
Martin Knipper