Author Topic: Compiling fs2_open CVS with GCC 4  (Read 3044 times)

0 Members and 1 Guest are viewing this topic.

Compiling fs2_open CVS with GCC 4
I just tried to compile fs2_open with GCC 4 and I got stuck at the file sounds/ds.cpp.

GCC gives me the following error message:

Code: [Select]
sound/ds.cpp: In function 'int ds_init(int, int, unsigned int, short unsigned int)':
sound/ds.cpp:1669: error: invalid conversion from 'void*' to 'ALCcontext*'
sound/ds.cpp:1669: error:   initializing argument 1 of 'ALCboolean alcMakeContextCurrent(ALCcontext*)'
sound/ds.cpp:1708: error: invalid conversion from 'ALubyte*' to 'const ALchar*'
sound/ds.cpp:1708: error:   initializing argument 1 of 'ALboolean alIsExtensionPresent(const ALchar*)'
sound/ds.cpp: In function 'void ds_close()':
sound/ds.cpp:2184: error: invalid conversion from 'void*' to 'ALCcontext*'
sound/ds.cpp:2184: error:   initializing argument 1 of 'void alcDestroyContext(ALCcontext*)'

 

Offline CaptJosh

  • 210
Compiling fs2_open CVS with GCC 4
Looks like what I ran into trying to compile it on SuSE 10. I think you might be missing your openAL-devel package.
CaptJosh

There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Compiling fs2_open CVS with GCC 4
Quote
Originally posted by Christoph_Berg
GCC gives me the following error message:[/CODE] [/B]

Your OpenAL package is either too new or too old.  If your OpenAL version is from earlier than about October of last year then you'll have to upgrade.  If it's a CVS build (what I'm guessing) of OpenAL then it's probably too new.  In general it will work with the too new version but you'll have to make the changes it describes:

1) change the context type from void* to ALCcontext* on ds_sound_context (line 633 in ds.cpp)
2) change the ALubyte* cast on line 1708 to ALchar*

That should get it building but I have been told that there are random sound and/or crashing issues when using the current code with OpenAL 1.1 (what's in CVS) so you'll have to watch out for that.  Full support for OpenAL 1.1 is in the works but not ready yet.  I'm not sure if the streaming audio code has any OpenAL 1.1 issues too but if it does just let me know what they are and I'll help you work around them.

 
Compiling fs2_open CVS with GCC 4
You are right. It's the CVS of OpenAL from two days ago. With your fixes everything compiles fine.

A short test confirmes your assumption of sound problems. There are short noises sometimes before in music and sound, but it's not that serious.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Compiling fs2_open CVS with GCC 4
Good to know.  I'm still in the process of rewriting the sound codeand only after that will 1.1 be fully supported.  The 1.1 version fixes several problems and makes standard some things that used to work only under Linux so I'm really looking forward to getting all of that integrated.  In the meantime I'll see if I can't get the noises taken care of without huring 1.0 support any.

 
Compiling fs2_open CVS with GCC 4
That's good to hear.

Just one question although it's a bit offtopic.

Once upon a time ;) I asked about extending the translation tables to be able to translate campaigns without needing to provide different versions of missions, which only differ from source files.

But as I'm doing translation work for another OpenSource project, I would say, perhaps it would be a good idea to switch the whole internationalization stuff to gettext, which would make translating FreeSpace into different languages really possible.

What do you think?

P.S: Split the topic if the question is to special.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Compiling fs2_open CVS with GCC 4
I had started working on a mod specific translation tbl a while back but it got rather scary so I scrapped it and have been rethinking what I should do.  I think I've got it worked out to the point that it's not so much of a problem to use but I haven't started coding it yet (should only take a day or two after I start).  This has been a long time coming though so I'll probably start work on it again early next month.

I considered gettext once before but after looking into it (briefly) there seemed to be too much of a burden on the Windows side of things.  There would be a fair amount of resistance to the idea from the other developers if that was the case so I decided against it.  I may have misunderstood the requirements and rewriting the current localization stuff wouldn't be too big of a deal but I don't want to implement both and the current method would still be required.  It's just easier to work out any bugs with what we have than it would be to plug in something else.

  
Compiling fs2_open CVS with GCC 4
Well, I'm working as the head German translator for Battle for Wesnoth, which also runs on Windows and MacOS X. They seem to have very good experience with gettext under Windows. Perhaps you can ask the lead developer.