Author Topic: Another compile error on Linux  (Read 6009 times)

0 Members and 1 Guest are viewing this topic.

Offline Col. Fishguts

  • voodoo doll
  • 211
Another compile error on Linux
Well, I tried to compile fresh from the CVS tree, on an up-to-date Gentoo install.

I followed the FS Wiki to the letter, and it starts happily compiling, but after a few minutes I get this:

Code: [Select]
In file included from /usr/include/GL/glx.h:25,
                 from graphics/gropengl.cpp:1002:
/usr/include/X11/Xmd.h:157: error: conflicting types for `typedef CARD8 BOOL'
windows_stub/config.h:136: error: previous declaration as `typedef int BOOL'
make[1]: *** [gropengl.o] Error 1
make[1]: Leaving directory `/home/elias/fs2src/fs2_open/code'
make: *** [all-recursive] Error 1

It doesn't seem to be one of the common errors mentioned in the wiki, and I can't really make heads or tail out of this, and Google doesn't know anything either.

What am I missing ? Can somebody shed some light on this, pretty please ?
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline ni1s

  • 26
Re: Another compile error on Linux
Oh! You ricer bastard!  :D

No worries, I'm a Gentoo user myself.  :)
As no two Gentoo system are alike, "an up-to-date Gentoo install" dosen't really help much.
What arch are you? x86 or ~x86 ?
Nvidia? ATI? Modular X(X11R7)?'
What dose '$ eselect opengl list' say?
You could post your 'emerge --info' but skip the Gentoo specific stuff(USE flags,PORTAGE_RSYNG etc, etc)

As I'm writing this, I compiled fs2_open, and all went fine.

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: Another compile error on Linux
Well, up-to-date as in just installed it freshly a month ago. It's a x86 box (Celeron 500, not the youngest I know) with a nVidia card, X11R6.

I haven't emerged eselect, do I need it ?

Some emerge --info output:

Code: [Select]

Portage 2.0.54 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2, 2.6.15-gentoo-r1 i686)
=================================================================
System uname: 2.6.15-gentoo-r1 i686 Celeron (Mendocino)
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i386-pc-linux-gnu"
CFLAGS="-O2 -march=pentium2 -pipe"
CHOST="i386-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"

And the important stuff from glxinfo:

Code: [Select]
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.3
server glx extensions:
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
    GLX_SGIX_pbuffer, GLX_SGI_video_sync, GLX_SGI_swap_control
client glx vendor string: NVIDIA Corporation
client glx version string: 1.3
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_visual_info,
    GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_SGI_video_sync,
    GLX_NV_swap_group, GLX_NV_video_out, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGI_swap_control, GLX_NV_float_buffer
GLX extensions:
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
    GLX_SGIX_pbuffer, GLX_SGI_video_sync, GLX_SGI_swap_control,
    GLX_ARB_get_proc_address
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce2 MX/AGP
OpenGL version string: 1.5.2 NVIDIA 66.29


Code: [Select]
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline fizz

  • 25
    • Crimson Fields
Re: Another compile error on Linux
I've got the exact same error, on a non-Gentoo system. I'm not sure what the correct solution would be, but as the BOOL typedef in fs2_open comes from the windows stubs header, it might be possible to eliminate it completely.

Then again, I'm not sure if X.org exporting such a generic type is a good idea in the first place... I'm pretty sure that it's changes in X.org which caused this error to suddenly appear.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Another compile error on Linux
I've got the exact same error, on a non-Gentoo system. I'm not sure what the correct solution would be, but as the BOOL typedef in fs2_open comes from the windows stubs header, it might be possible to eliminate it completely.
It can't be removed from the windows stubs header, since there would by a type incompatibility otherwise.  We could probably just get away with an "#undef BOOL" in gropengl.cpp though, just before glx.h is included.  The BOOL type isn't used in gropengl.cpp so it shouldn't cause any problems to do that.

Of course the BOOL type is going to be removed soon anyway, as will pretty much every other Windows specific define/type.  Also, the GL code will not have to include glx.h soon either so it wouldn't be a problem either way.

 

Offline fizz

  • 25
    • Crimson Fields
Re: Another compile error on Linux
It can't be removed from the windows stubs header, since there would by a type incompatibility otherwise.  We could probably just get away with an "#undef BOOL" in gropengl.cpp though, just before glx.h is included.  The BOOL type isn't used in gropengl.cpp so it shouldn't cause any problems to do that.

I can't try right now, but is it even possible to #undef a #typedef?

Quote
Of course the BOOL type is going to be removed soon anyway, as will pretty much every other Windows specific define/type.  Also, the GL code will not have to include glx.h soon either so it wouldn't be a problem either way.

That's what I meant when I said we might be able to eliminate it, at least from non-Windows source paths.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Another compile error on Linux
I can't try right now, but is it even possible to #undef a #typedef?
Bah, I wasn't looking at it that closely.  So #undef certainly wouldn't work then.

I'll try and get some of the updated GL code in CVS this weekend.  If I don't have time to do that, then at the very least I'll have the glx.h header be unnecessary.

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: Another compile error on Linux
So, is there something I can fix on my end, or should I wait for further developments ?
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Another compile error on Linux
So, is there something I can fix on my end, or should I wait for further developments ?
The only thing glx.h does is give you v-sync support, and that's only one function.  You should just be able to replace the "#include <GL/glx.h>" line with "extern int glXSwapIntervalSGI(int);" and have it compile and work fine.

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: Another compile error on Linux
Ok, and in which file would #include <GL/glx.h> be ?
I'm not familiar with the FS2_open source, and there are kinda many files ;)


EDIT: Found it, it's compiling now. Thanks muchly

EDIT2: Well, after a close inspection of the error message, I saw that it was actually telling me that it was in gropengl.cpp
« Last Edit: March 31, 2006, 11:27:15 am by Col. Fishguts »
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Another compile error on Linux
Oops, sorry. :D

It's in code/graphics/gropengl.cpp.

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: Another compile error on Linux
Hmm, after about 15mins of further compiling it hangs again. Seems it doesn't like the glXSwapIntervalSGI(int) function after all:

Code: [Select]
g++ -g -O2 -Wall -I/usr/include/SDL -D_REENTRANT -fsigned-char -Wno-unknown-pragmas  -Wno-deprecated -Wno-char-subscripts -I../lua  -g  -lSDL -lpthread
-lGL -lGLU -lopenal -logg -lvorbis -lvorbisfile  -o fs2_open_r  freespace.o levelpaging.o libcode.a ../libjpeg/libjpeg.a ../lua/liblua.a
libcode.a(gropengl.o): In function `opengl_set_vsync(int)':
graphics/gropengl.cpp:3964: undefined reference to `glXSwapIntervalSGI(int)'
collect2: ld returned 1 exit status
make[1]: *** [fs2_open_r] Error 1
make[1]: Leaving directory `/home/elias/fs2src/fs2_open/code'
make: *** [all-recursive] Error 1

Funnily the comments at line 3964 say:
Code: [Select]
// NOTE: this may not work well with the closed NVIDIA drivers since those use the
        //       special "__GL_SYNC_TO_VBLANK" environment variable to manage sync
        if ( opengl_extension_is_enabled(GL_SPC_GLX_SWAP_INTERVAL, 1) ) {
                glXSwapIntervalSGI(status);

I'm using the nVidia closed drivers, is this a problem during compiling ?

EDIT: Phew, I got it to finish compiling by commenting out that function on line 3964, I don't need V-Sync anyway. But it's a hacky solution, I'm sure there's a more correct way to fix it.

EDIT2: Yay, it works ! For some strange reason the executable is 25 MB in size but it runs pretty smooth on that old box
« Last Edit: March 31, 2006, 02:29:56 pm by Col. Fishguts »
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 
Re: Another compile error on Linux
Code: [Select]
strip fs2_open_r
:)

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: Another compile error on Linux
Code: [Select]
strip fs2_open_r
:)

Thanks, that brought it down to ~3MB :)

Now, the last thing glitch remaining, is that my swiss-german keyboard layout isn't recognised. It defaults to an american keyboard, but I can't bind any functions to the keys which are not recognised.
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Another compile error on Linux
I'm using the nVidia closed drivers, is this a problem during compiling ?
No, I'm just not totally how sure it will behave if you have the NVIDIA env variable set to sync and also have the game set to do sync.  It may work fine, or do strange stuff.  I'm going to add new code which tests for the env var and if it's set then it won't try to call glXSwapIntervalSGI, just to be on the safe side.  Also, I think I've got it working well without having to include glxext.h so you be able use plain CVS and have it compile fine when the update finally hits.