I'm trying to build libgd and can't seem to get past this error. It configures without error but when I go to
make Install the below error occurs. Would anyone know how to get past this?

WinXP, MingW.

Thanks.

gdfontg.c:4380: error: variable 'gdFontGiant' definition is marked dllimport
gdfontg.c:4380: warning: 'gdFontGiant' redeclared without dllimport attribute: previous dllimport ignored

Well, it depends on which version I use.
An earlier version gives me the below errors. I tried adjusting the CmakeLists File to include all the requiremens for libgd and now it's telling me that it can't see jpeglib.h which is obviously the Libjpeg header.

Has anyone built libgd on windows?

The instructions say the below.

The following 3rd-party libraries will be used by gd if found by configure.
While gd will compile and install even without these, we suggest that at
least zlib and libpng are installed, and recommend that freetype and jpeg
are installed as well:

So I could even get away without libjpeg but having said that it should build with it?

C:\libgd>mingw32-make -f Makefile
[  3%] Building C object CMakeFiles/gd.dir/gd_jpeg.obj
C:\libgd\gd_jpeg.c:47:21: error: jpeglib.h: No such file or directory
C:\libgd\gd_jpeg.c:48:20: error: jerror.h: No such file or directory
C:\libgd\gd_jpeg.c:60: error: expected ')' before 'cinfo'
C:\libgd\gd_jpeg.c:112: error: expected ')' before 'cinfo'
C:\libgd\gd_jpeg.c: In function 'gdImageJpegCtx':
C:\libgd\gd_jpeg.c:116: error: storage size of 'cinfo' isn't known
C:\libgd\gd_jpeg.c:117: error: storage size of 'jerr' isn't known
C:\libgd\gd_jpeg.c:120: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'row'
C:\libgd\gd_jpeg.c:120: error: 'row' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:120: error: (Each undeclared identifier is reported only once
C:\libgd\gd_jpeg.c:120: error: for each function it appears in.)
C:\libgd\gd_jpeg.c:121: error: 'JSAMPROW' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:121: error: expected ';' before 'rowptr'
C:\libgd\gd_jpeg.c:123: error: 'JDIMENSION' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:123: error: expected ';' before 'nlines'
C:\libgd\gd_jpeg.c:154: error: 'fatal_jpeg_error' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:161: error: 'JCS_RGB' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:178: error: expected ';' before 'gdCalloc'
C:\libgd\gd_jpeg.c:188: error: 'rowptr' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:193: error: 'JPEG_LIB_VERSION' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:198: error: 'JPEG_COM' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:222: error: 'nlines' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:250:2: error: #error IJG JPEG library BITS_IN_JSAMPLE value must be 8 or 12
C:\libgd\gd_jpeg.c: At top level:
C:\libgd\gd_jpeg.c:283: error: expected ')' before 'cinfo'
C:\libgd\gd_jpeg.c: In function 'gdImageCreateFromJpegCtx':
C:\libgd\gd_jpeg.c:293: error: storage size of 'cinfo' isn't known
C:\libgd\gd_jpeg.c:294: error: storage size of 'jerr' isn't known
C:\libgd\gd_jpeg.c:297: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'row'
C:\libgd\gd_jpeg.c:297: error: 'row' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:299: error: 'JSAMPROW' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:299: error: expected ';' before 'rowptr'
C:\libgd\gd_jpeg.c:301: error: 'JDIMENSION' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:301: error: expected ';' before 'nrows'
C:\libgd\gd_jpeg.c:325: error: 'fatal_jpeg_error' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:333: error: 'JPEG_APP0' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:336: error: 'JPEG_HEADER_OK' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:360: error: 'JCS_CMYK' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:361: error: 'JCS_YCCK' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:367: error: 'JCS_RGB' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:444: error: 'jpeg_saved_marker_ptr' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:444: error: expected ';' before 'marker'
C:\libgd\gd_jpeg.c:453: error: 'marker' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:481: error: 'JSAMPLE' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:488: error: 'rowptr' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:493: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'currow'
C:\libgd\gd_jpeg.c:493: error: 'currow' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:495: error: 'nrows' undeclared (first use in this function)
C:\libgd\gd_jpeg.c:514: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'currow'
C:\libgd\gd_jpeg.c: At top level:
C:\libgd\gd_jpeg.c:634: error: field 'pub' has incomplete type
C:\libgd\gd_jpeg.c:653: error: expected ')' before 'cinfo'
C:\libgd\gd_jpeg.c:700: error: expected ')' before 'cinfo'
C:\libgd\gd_jpeg.c:768: error: expected ')' before 'cinfo'
C:\libgd\gd_jpeg.c:810: error: expected ')' before 'cinfo'
C:\libgd\gd_jpeg.c:828: error: expected ')' before 'cinfo'
C:\libgd\gd_jpeg.c:866: error: field 'pub' has incomplete type
C:\libgd\gd_jpeg.c:882: error: expected ')' before 'cinfo'
C:\libgd\gd_jpeg.c:920: error: expected ')' before 'cinfo'
C:\libgd\gd_jpeg.c:945: error: expected ')' before 'cinfo'
C:\libgd\gd_jpeg.c:966: error: expected ')' before 'cinfo'
mingw32-make[2]: *** [CMakeFiles/gd.dir/gd_jpeg.obj] Error 1
mingw32-make[1]: *** [CMakeFiles/gd.dir/all] Error 2
mingw32-make: *** [all] Error 2

I tried using CMAKE to create a makefile and then tried building using 'make install' and got the below error.

make[1]: Entering directory `/c/libgd'
if gcc -DHAVE_CONFIG_H -DHAVE_BOOLEAN  -I. -I. -I.   -I/usr/local/include/freetype2 -I/usr/local/include   -g -O2 -MT
 gdcmpgif.o -MD -MP -MF ".deps/gdcmpgif.Tpo" -c -o gdcmpgif.o gdcmpgif.c; \
        then mv -f ".deps/gdcmpgif.Tpo" ".deps/gdcmpgif.Po"; else rm -f ".deps/gdcmpgif.Tpo"; exit 1; fi
In file included from gdcmpgif.c:9:
gd.h:38:1: warning: "BGD_DECLARE" redefined
gd.h:32:1: warning: this is the location of the previous definition
In file included from gdcmpgif.c:9:
gd.h:728: error: conflicting types for 'gdNewFileCtx'
./io.h:39: note: previous declaration of 'gdNewFileCtx' was here
gd.h:735: error: conflicting types for 'gdNewDynamicCtx'
./io.h:40: note: previous declaration of 'gdNewDynamicCtx' was here
gd.h:746: error: conflicting types for 'gdDPExtractData'
./io.h:41: note: previous declaration of 'gdDPExtractData' was here
make[1]: *** [gdcmpgif.o] Error 1
make[1]: Leaving directory `/c/libgd'
make: *** [install-recursive] Error 1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.