Help on compiling gles-1.0c on Linux

Hi everyone,

i have been compiling gles-1.0.c on OpenSuse Linux 11.1

vehbi@linux-awan:~/Desktop/gles-1.0c> make
if [ -d es ]; then  make -C es ; fi
make[1]: Entering directory `/home/vehbi/Desktop/gles-1.0c/es'
gcc -o gentable gentable.c -lm
./gentable -s > gl_sin.h
gcc -Wall -O3 -fno-inline-functions -fno-builtin -D__lint__ -I..   -c -o gl.o gl.c
gcc -Wall -O3 -fno-inline-functions -fno-builtin -D__lint__ -I..   -c -o matrix.o matrix.c
gcc -Wall -O3 -fno-inline-functions -fno-builtin -D__lint__ -I..   -c -o light.o light.c
gcc -Wall -O3 -fno-inline-functions -fno-builtin -D__lint__ -I..   -c -o math.o math.c
gcc -Wall -O3 -fno-inline-functions -fno-builtin -D__lint__ -I..   -c -o vtx.o vtx.c
vtx.c: In function ‘__gl_array’:
vtx.c:224: warning: pointer type mismatch in conditional expression
vtx.c:231: warning: dereferencing type-punned pointer will break strict-aliasing rules
vtx.c:237: warning: dereferencing type-punned pointer will break strict-aliasing rules
vtx.c:249: warning: dereferencing type-punned pointer will break strict-aliasing rules
vtx.c:279: warning: dereferencing type-punned pointer will break strict-aliasing rules
vtx.c:282: warning: dereferencing type-punned pointer will break strict-aliasing rules
vtx.c:308: warning: dereferencing type-punned pointer will break strict-aliasing rules
vtx.c:343: warning: dereferencing type-punned pointer will break strict-aliasing rules
gcc -Wall -O3 -fno-inline-functions -fno-builtin -D__lint__ -I..   -c -o get.o get.c
get.c: In function ‘glGetString’:
get.c:141: warning: pointer targets in initialization differ in signedness
get.c:142: warning: pointer targets in initialization differ in signedness
get.c:146: warning: pointer targets in initialization differ in signedness
get.c:150: warning: pointer targets in initialization differ in signedness
gcc -Wall -O3 -fno-inline-functions -fno-builtin -D__lint__ -I..   -c -o glras.o glras.c
glras.c: In function ‘__gl_first_init’:
glras.c:1477: warning: cast to pointer from integer of different size
glras.c:1479: warning: cast to pointer from integer of different size
glras.c:1503: warning: cast to pointer from integer of different size
glras.c: In function ‘__ddx_createcontext’:
glras.c:1713: warning: cast to pointer from integer of different size
glras.c: In function ‘__ddx_makecurrent’:
glras.c:1735: warning: pointer targets in passing argument 3 of ‘dd->getgeometry’ differ in signedness
glras.c:1735: warning: pointer targets in passing argument 4 of ‘dd->getgeometry’ differ in signedness
glras.c: In function ‘__gl_ras_viewport’:
glras.c:1796: warning: pointer targets in passing argument 3 of ‘((struct __ddif_t *)gl->dd.ddif)->getgeometry’ differ in signedness
glras.c:1796: warning: pointer targets in passing argument 4 of ‘((struct __ddif_t *)gl->dd.ddif)->getgeometry’ differ in signedness
gcc -Wall -O3 -fno-inline-functions -fno-builtin -D__lint__ -I..   -c -o debug.o debug.c
ar ru libGLES_CL.a gl.o matrix.o light.o math.o vtx.o get.o glras.o debug.o
ld -o libGLES_CL.so -shared gl.o matrix.o light.o math.o vtx.o get.o glras.o debug.o -L/usr/X11R6/lib -lX11 -lm
[b]ld: gl.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
gl.o: could not read symbols: Bad value
make[1]: *** [libGLES_CL.a] Error 1
make[1]: Leaving directory `/home/vehbi/Desktop/gles-1.0c/es'
make: *** [es] Error 2[/b]
vehbi@linux-awan:~/Desktop/gles-1.0c> 

As you may see there is an error, how do i solve this?

Thanks in advance

There’re multiple problem, and more since you’re trying to build under a x86_64 (amd64) system.
Unfortunately, code and compilation options are not compatible with this kind of configuration:
options lack of -DPIC -fPIC, code is trying to convert integer (32bits) to pointer (64bits).

Hopefully, I have a patch that try to clean up the mess : https://quoi.quest-ce.net/data/opengl/gles-1.0c-patch1.diff.
This patch apply on top of so called “OpenGL ES 1.0 Linux Sample Reference Implementation” (aka GLESonGL) sources : http://www.khronos.org/opengles/documentation/gles-1.0c.tgz.

BTW, if you really want to use OpenGL ES under Linux, see Mesa / Gallium 3D.
If not already done, an OpenGL ES support is going to be added to Mesa / Gallium3D: see OpenGL ES 1.1/2.0 State Trackers For Gallium3D - Phoronix

Regards.

There’s a new version which fixed problems reported by llvm / clang.
You can found it here: https://quoi.quest-ce.net/data/opengl/gles-1.0c-patch2.diff.

Regards.

Thanks for the patch. It compiled fine and the test programm works(using Ubuntuy 9.04 64bit). However, the examples from the redbook wont work. I managed to compile them (with a bit of work on the makefile) but however, execution shows only a black screen.

Any idea about this ?
Thanks and best regards
Anes

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.