# FreeType2 and Code::Blocks on Kubuntu

## Recommended Posts

I've been trying to move over to developing my engine on linux and really make it cross platform, but in the process I've hit a slight wall getting the freetype 2 library to work. When I compile the example code I get this error from Code::Blocks
Quote:
 Code::Blocks Build messages /home/bernard/Development_Tools/Libs/freetype-2.3.5/src/gzip/ftgzip.c:303: undefined reference to inflateEnd' /home/bernard/Development_Tools/Libs/freetype-2.3.5/src/gzip/ftgzip.c:406: undefined reference to inflate' /home/bernard/Development_Tools/Libs/freetype-2.3.5/src/gzip/ftgzip.c:332: undefined reference to inflateReset' /home/bernard/Development_Tools/Libs/freetype-2.3.5/src/gzip/ftgzip.c:288: undefined reference to inflateInit2_' :: === Build finished: 4 errors, 0 warnings ===
The error occurs in "ftgzip.c" which comes with freetype2. I am wondering if I need to link with zlib or not. I figure that linux has zlib installed already but I don't know where to find the library file. Do you have to get zlib too? I did install libpng but linking with it didn't clear up the error. I haven't tested libpng yet.

##### Share on other sites
yes, you must link against zlib ( -lz )

nice to see more linux support in the game dev world.

##### Share on other sites
Well I found that but now I want to start using (or at least try) glfw as a cross-platform solution to creating windows, getting keyboard/mouse input, and using timers (no I do not want SDL), and it cannot find glu.h. I can't find glu.h either. Where do I get glu.h?
*edit*
So I have to install Mesa which requires DRI and glproto and both of those affect xorg and every other time that I had to mess with xorg I've lost video and had to adjust xorg.conf from the terminal in recovery mode.

I'm really not looking forward to this processes.

I sure hope there's an easier way.

[Edited by - T1Oracle on July 10, 2007 11:00:20 AM]

##### Share on other sites
Quote:
 Teminal promptbernard@bernard-desktop:~/Development_Tools/Libs/Mesa-7.0$sudo make linux-dri(cd configs && rm -f current && ln -s linux-dri current)make defaultmake[1]: Entering directory /home/bernard/Development_Tools/Libs/Mesa-7.0'make[2]: Entering directory /home/bernard/Development_Tools/Libs/Mesa-7.0/src'Making sources for linux-drimkdir ../libmake[3]: Entering directory /home/bernard/Development_Tools/Libs/Mesa-7.0/src/glx/x11'Makefile:91: depend: No such file or directorytouch dependmakedepend -fdepend -I. -I../../../include -I../../../include/GL/internal -I../../../src/mesa/main -I../../../src/mesa/glapi pkg-config --cflags libdrm -I/usr/X11R6/include glcontextmodes.c clientattrib.c compsize.c eval.c glxcmds.c glxext.c glxextensions.c indirect.c indirect_init.c indirect_size.c indirect_window_pos.c indirect_transpose_matrix.c indirect_vertex_array.c indirect_vertex_program.c pixel.c pixelstore.c render2.c renderpix.c single2.c singlepix.c vertarr.c xfont.c glx_pbuffer.c glx_query.c glx_texture_compression.c dri_glx.c XF86dri.c ../../../src/mesa/main/dispatch.c ../../../src/mesa/glapi/glapi.c ../../../src/mesa/glapi/glthread.cmakedepend: warning: glcontextmodes.c (reading /usr/include/bits/types.h, line 31): cannot find include file "stddef.h" not in ./stddef.h not in ../../../include/stddef.h not in ../../../include/GL/internal/stddef.h not in ../../../src/mesa/main/stddef.h not in ../../../src/mesa/glapi/stddef.h not in /usr/local/include/stddef.h not in /usr/local/include/drm/stddef.h not in /usr/X11R6/include/stddef.h not in /usr/include/stddef.hmakedepend: warning: glcontextmodes.c (reading /usr/include/sys/types.h, line 147): cannot find include file "stddef.h" not in ./stddef.h not in ../../../include/stddef.h not in ../../../include/GL/internal/stddef.h not in ../../../src/mesa/main/stddef.h not in ../../../src/mesa/glapi/stddef.h not in /usr/local/include/stddef.h not in /usr/local/include/drm/stddef.h not in /usr/X11R6/include/stddef.h not in /usr/include/stddef.hmakedepend: warning: glcontextmodes.c (reading /usr/include/X11/Xlib.h, line 75): cannot find include file "stddef.h" not in ./stddef.h not in ../../../include/stddef.h not in ../../../include/GL/internal/stddef.h not in ../../../src/mesa/main/stddef.h not in ../../../src/mesa/glapi/stddef.h not in /usr/local/include/stddef.h not in /usr/local/include/drm/stddef.h not in /usr/X11R6/include/stddef.h not in /usr/include/stddef.hmakedepend: warning: glcontextmodes.c (reading ../../../include/GL/glext.h, line 3385): cannot find include file "stddef.h" not in ./stddef.h not in ../../../include/stddef.h not in ../../../include/GL/internal/stddef.h not in ../../../src/mesa/main/stddef.h not in ../../../src/mesa/glapi/stddef.h not in /usr/local/include/stddef.h not in /usr/local/include/drm/stddef.h not in /usr/X11R6/include/stddef.h not in /usr/include/stddef.hmakedepend: warning: glcontextmodes.c (reading /usr/include/inttypes.h, line 38): cannot find include file "stddef.h" not in ./stddef.h not in ../../../include/stddef.h not in ../../../include/GL/internal/stddef.h not in ../../../src/mesa/main/stddef.h not in ../../../src/mesa/glapi/stddef.h not in /usr/local/include/stddef.h not in /usr/local/include/drm/stddef.h not in /usr/X11R6/include/stddef.h not in /usr/include/stddef.hmakedepend: warning: glcontextmodes.c (reading /usr/include/string.h, line 33): cannot find include file "stddef.h" not in ./stddef.h not in ../../../include/stddef.h not in ../../../include/GL/internal/stddef.h not in ../../../src/mesa/main/stddef.h not in ../../../src/mesa/glapi/stddef.h not in /usr/local/include/stddef.h not in /usr/local/include/drm/stddef.h not in /usr/X11R6/include/stddef.h not in /usr/include/stddef.hmakedepend: warning: glcontextmodes.c (reading /usr/include/stdlib.h, line 33): cannot find include file "stddef.h" not in ./stddef.h not in ../../../include/stddef.h not in ../../../include/GL/internal/stddef.h not in ../../../src/mesa/main/stddef.h not in ../../../src/mesa/glapi/stddef.h not in /usr/local/include/stddef.h not in /usr/local/include/drm/stddef.h not in /usr/X11R6/include/stddef.h not in /usr/include/stddef.hmakedepend: warning: glcontextmodes.c (reading /usr/include/alloca.h, line 25): cannot find include file "stddef.h" not in ./stddef.h not in ../../../include/stddef.h not in ../../../include/GL/internal/stddef.h not in ../../../src/mesa/main/stddef.h not in ../../../src/mesa/glapi/stddef.h not in /usr/local/include/stddef.h not in /usr/local/include/drm/stddef.h not in /usr/X11R6/include/stddef.h not in /usr/include/stddef.hmakedepend: warning: glcontextmodes.c (reading /usr/include/X11/Xlibint.h, line 347): cannot find include file "stddef.h" not in ./stddef.h not in ../../../include/stddef.h not in ../../../include/GL/internal/stddef.h not in ../../../src/mesa/main/stddef.h not in ../../../src/mesa/glapi/stddef.h not in /usr/local/include/stddef.h not in /usr/local/include/drm/stddef.h not in /usr/X11R6/include/stddef.h not in /usr/include/stddef.hmakedepend: warning: clientattrib.c (reading /usr/include/stdio.h, line 34): cannot find include file "stddef.h" not in ./stddef.h not in ../../../include/stddef.h not in ../../../include/GL/internal/stddef.h not in ../../../src/mesa/main/stddef.h not in ../../../src/mesa/glapi/stddef.h not in /usr/local/include/stddef.h not in /usr/local/include/drm/stddef.h not in /usr/X11R6/include/stddef.h not in /usr/include/stddef.hmakedepend: warning: clientattrib.c (reading /usr/include/_G_config.h, line 14): cannot find include file "stddef.h" not in ./stddef.h not in ../../../include/stddef.h not in ../../../include/GL/internal/stddef.h not in ../../../src/mesa/main/stddef.h not in ../../../src/mesa/glapi/stddef.h not in /usr/local/include/stddef.h not in /usr/local/include/drm/stddef.h not in /usr/X11R6/include/stddef.h not in /usr/include/stddef.hmakedepend: warning: clientattrib.c (reading /usr/include/wchar.h, line 48): cannot find include file "stddef.h" not in ./stddef.h not in ../../../include/stddef.h not in ../../../include/GL/internal/stddef.h not in ../../../src/mesa/main/stddef.h not in ../../../src/mesa/glapi/stddef.h not in /usr/local/include/stddef.h not in /usr/local/include/drm/stddef.h not in /usr/X11R6/include/stddef.h not in /usr/include/stddef.hmakedepend: warning: clientattrib.c (reading /usr/include/gconv.h, line 31): cannot find include file "stddef.h" not in ./stddef.h not in ../../../include/stddef.h not in ../../../include/GL/internal/stddef.h not in ../../../src/mesa/main/stddef.h not in ../../../src/mesa/glapi/stddef.h not in /usr/local/include/stddef.h not in /usr/local/include/drm/stddef.h not in /usr/X11R6/include/stddef.h not in /usr/include/stddef.hmakedepend: warning: clientattrib.c (reading /usr/include/libio.h, line 53): cannot find include file "stdarg.h" not in ./stdarg.h not in ../../../include/stdarg.h not in ../../../include/GL/internal/stdarg.h not in ../../../src/mesa/main/stdarg.h not in ../../../src/mesa/glapi/stdarg.h not in /usr/local/include/stdarg.h not in /usr/local/include/drm/stdarg.h not in /usr/X11R6/include/stdarg.h not in /usr/include/stdarg.hmakedepend: warning: glxcmds.c (reading /usr/include/limits.h, line 125): cannot find include file "limits.h"makedepend: warning: glxcmds.c (reading ../../../src/mesa/main/glheader.h, line 68): cannot find include file "float.h" not in ./float.h not in ../../../include/float.h not in ../../../include/GL/internal/float.h not in ../../../src/mesa/main/float.h not in ../../../src/mesa/glapi/float.h not in /usr/local/include/float.h not in /usr/local/include/drm/float.h not in /usr/X11R6/include/float.h not in /usr/include/float.hmakedepend: warning: glxcmds.c (reading ../../../src/mesa/main/glheader.h, line 69): cannot find include file "stdarg.h" not in ./stdarg.h not in ../../../include/stdarg.h not in ../../../include/GL/internal/stdarg.h not in ../../../src/mesa/main/stdarg.h not in ../../../src/mesa/glapi/stdarg.h not in /usr/local/include/stdarg.h not in /usr/local/include/drm/stdarg.h not in /usr/X11R6/include/stdarg.h not in /usr/include/stdarg.hmakedepend: warning: glxext.c, line 51: cannot find include file "X11/extensions/Xfixes.h" not in ./X11/extensions/Xfixes.h not in ../../../include/X11/extensions/Xfixes.h not in ../../../include/GL/internal/X11/extensions/Xfixes.h not in ../../../src/mesa/main/X11/extensions/Xfixes.h not in ../../../src/mesa/glapi/X11/extensions/Xfixes.h not in /usr/local/include/X11/extensions/Xfixes.h not in /usr/local/include/drm/X11/extensions/Xfixes.h not in /usr/X11R6/include/X11/extensions/Xfixes.h not in /usr/include/X11/extensions/Xfixes.hmakedepend: warning: glxext.c, line 52: cannot find include file "X11/extensions/Xdamage.h" not in ./X11/extensions/Xdamage.h not in ../../../include/X11/extensions/Xdamage.h not in ../../../include/GL/internal/X11/extensions/Xdamage.h not in ../../../src/mesa/main/X11/extensions/Xdamage.h not in ../../../src/mesa/glapi/X11/extensions/Xdamage.h not in /usr/local/include/X11/extensions/Xdamage.h not in /usr/local/include/drm/X11/extensions/Xdamage.h not in /usr/X11R6/include/X11/extensions/Xdamage.h not in /usr/include/X11/extensions/Xdamage.hmake[3]: Leaving directory /home/bernard/Development_Tools/Libs/Mesa-7.0/src/glx/x11'make[3]: Entering directory /home/bernard/Development_Tools/Libs/Mesa-7.0/src/glx/x11'gcc -c -I. -I../../../include -I../../../include/GL/internal -I../../../src/mesa/main -I../../../src/mesa/glapi pkg-config --cflags libdrm -I/usr/X11R6/include -Wall -Wmissing-prototypes -std=c99 -ffast-math -O -g -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER -DDEFAULT_DRIVER_DIR=\"/usr/X11R6/lib/modules/dri\" glcontextmodes.c -o glcontextmodes.ogcc -c -I. -I../../../include -I../../../include/GL/internal -I../../../src/mesa/main -I../../../src/mesa/glapi pkg-config --cflags libdrm -I/usr/X11R6/include -Wall -Wmissing-prototypes -std=c99 -ffast-math -O -g -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER -DDEFAULT_DRIVER_DIR=\"/usr/X11R6/lib/modules/dri\" clientattrib.c -o clientattrib.ogcc -c -I. -I../../../include -I../../../include/GL/internal -I../../../src/mesa/main -I../../../src/mesa/glapi pkg-config --cflags libdrm -I/usr/X11R6/include -Wall -Wmissing-prototypes -std=c99 -ffast-math -O -g -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER -DDEFAULT_DRIVER_DIR=\"/usr/X11R6/lib/modules/dri\" compsize.c -o compsize.ogcc -c -I. -I../../../include -I../../../include/GL/internal -I../../../src/mesa/main -I../../../src/mesa/glapi pkg-config --cflags libdrm -I/usr/X11R6/include -Wall -Wmissing-prototypes -std=c99 -ffast-math -O -g -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER -DDEFAULT_DRIVER_DIR=\"/usr/X11R6/lib/modules/dri\" eval.c -o eval.ogcc -c -I. -I../../../include -I../../../include/GL/internal -I../../../src/mesa/main -I../../../src/mesa/glapi pkg-config --cflags libdrm -I/usr/X11R6/include -Wall -Wmissing-prototypes -std=c99 -ffast-math -O -g -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER -DDEFAULT_DRIVER_DIR=\"/usr/X11R6/lib/modules/dri\" glxcmds.c -o glxcmds.ogcc -c -I. -I../../../include -I../../../include/GL/internal -I../../../src/mesa/main -I../../../src/mesa/glapi pkg-config --cflags libdrm -I/usr/X11R6/include -Wall -Wmissing-prototypes -std=c99 -ffast-math -O -g -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER -DDEFAULT_DRIVER_DIR=\"/usr/X11R6/lib/modules/dri\" glxext.c -o glxext.oglxext.c:51:35: error: X11/extensions/Xfixes.h: No such file or directoryglxext.c:52:36: error: X11/extensions/Xdamage.h: No such file or directoryglxext.c:781: warning: initialization from incompatible pointer typeglxext.c:783: warning: initialization from incompatible pointer typeglxext.c:788: warning: initialization from incompatible pointer typeglxext.c:791: warning: initialization from incompatible pointer typeglxext.c:793: warning: initialization from incompatible pointer typemake[3]: *** [glxext.o] Error 1make[3]: Leaving directory /home/bernard/Development_Tools/Libs/Mesa-7.0/src/glx/x11'make[2]: *** [subdirs] Error 1make[2]: Leaving directory /home/bernard/Development_Tools/Libs/Mesa-7.0/src'make[1]: *** [default] Error 1make[1]: Leaving directory /home/bernard/Development_Tools/Libs/Mesa-7.0'make: *** [linux-dri] Error 2bernard@bernard-desktop:~/Development_Tools/Libs/Mesa-7.0$

This whole process just looks like it's headed straight for another black screen of despair (BSOD) :(

##### Share on other sites
nVidia provides GL headers and static libraries with their drivers, I'm not sure about ATI.

##### Share on other sites
...Obviously not. I have the nVidia 9755 driver for my GeForce 8800GLX and the glu.h file is no where to be found on my linux partition. Everything else about opengl works just fine, I just don't have glu or glut.
*edit*

So I found this random site through google that lets me download glproto 1.4.8 but it has no install instructions so try to run install-h and cross my fingers. No dice :(

*edit*
Solved it, I had to install "freeglut3-dev" using apt-get.

[Edited by - T1Oracle on July 10, 2007 10:01:21 PM]

##### Share on other sites
Strange, I seem to remember the nVidia installer doing that [looksaround]

## Create an account

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627636
• Total Posts
2978331

• 10
• 12
• 22
• 13
• 33