Help on compiling gles-1.0c on Linux

Hi all

As per subject line, I get the following error:


$ make
if [ -d es ]; then  make -C es ; fi
make[1]: Entering directory
`/mnt/sda1/home/lelanthran/old/lmanickum/src/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:222: error: lvalue required as increment operand
vtx.c:222: error: lvalue required as increment operand
vtx.c:229: warning: dereferencing type-punned pointer will break
strict-aliasing rules
vtx.c:235: warning: dereferencing type-punned pointer will break
strict-aliasing rules
vtx.c:247: warning: dereferencing type-punned pointer will break
strict-aliasing rules
vtx.c:277: warning: dereferencing type-punned pointer will break
strict-aliasing rules
vtx.c:280: warning: dereferencing type-punned pointer will break
strict-aliasing rules
vtx.c:306: warning: dereferencing type-punned pointer will break
strict-aliasing rules
vtx.c:341: warning: dereferencing type-punned pointer will break
strict-aliasing rules
make[1]: *** [vtx.o] Error 1
make[1]: Leaving directory
`/mnt/sda1/home/lelanthran/old/lmanickum/src/gles-1.0c/es'
make: *** [es] Error 2
$ 

A google search turned up no one else with this problem, so I’m
inclined to suspect that it may be my system that is the problem.

My system is as follows:


$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.10
DISTRIB_CODENAME=intrepid
DISTRIB_DESCRIPTION="Ubuntu 8.10"
$ uname 
Linux lmanickum-ds2 2.6.27-7-server #1 SMP Fri Oct 24 07:37:55 UTC 2008
i686 GNU/Linux
$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.3.2-1ubuntu11' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--enable-mpfr --enable-targets=all --enable-checking=release
--build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu11)
$ 

Any help would be appreciated,
Kind Regards

I get the same error, so it’s not just your setup.

Anyway, the issue seems to be the way indices is updated, where the cast seems to prevent indices from being an l-value (which makes sense to me). Here’s a quick patch I’ve done to avoid this issue:

222c222,223
<     j = type == 0 ? *((__gl_ub*)indices)++ : *((__gl_us*)indices)++;
---
>     j = type == 0 ? *((__gl_ub*)indices) : *((__gl_us*)indices);
>     indices = type == 0 ? *((__gl_ub*)indices + 1) : *((__gl_us*)indices + 1);

I hope this helps.

Thanks, that works wonderfully :slight_smile:

Kind Regards

I think my variant is better:


<     j = type == 0 ? *((__gl_ub*)indices)++ : *((__gl_us*)indices)++;
---
>                     j = type == 0 ? *((__gl_ub*)indices) : *((__gl_us*)indices);
>                     indices = type == 0 ? (__gl_ub*)indices + 1 : (__gl_us*)indices + 1;

The kusma’s variant causes a crash when ‘glDrawElements’ method is being called.

I’ve made a patch on gles-1.0c to fix multiple problems in the package in order to build it on x86_64.

See this post: viewtopic.php?p=5488#p5488

Seems like the code of vtx.c is borked up. This is not a OpenGL problem, but a problem of the software to compile. I take the compilation log, and bug the code maintainer about it.

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