The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => Technical Issues => Topic started by: Juffo on April 08, 2006, 08:49:04 pm



Title: Some issues compiling with MINGW/MSYS
Post by: Juffo on April 08, 2006, 08:49:04 pm
1- I get the following error:
Code:
./config_win.h:45: error: stray '@' in program
c:/programmi/mingw/bin/../lib/gcc/mingw32/3.4.2/include/stddef.h:151: error: syntax error before "typedef"
the guilty line is simply
@HAVE_GETOPT_H@
I changed it to
#define HAVE_GETOPT_H
and it works. However:

2 - after running build.sh uqm config and setting to optimized release version the file size is 1.81 MB, almost the double than the release. Is the normal behavior of using MinGW?

3 - running "build.sh uqm config" I set to include OpenAL support (experimental) but then I get the following error:
Code:
  LINK     uqm
obj/release/src/sc2code/libs/sound/audiocore.c.o(.text+0x3c):audiocore.c: undefined reference to `openAL_Init'
collect2: ld returned 1 exit status
make: *** [uqm] Error 1


Title: Re: Some issues compiling with MINGW/MSYS
Post by: meep-eep on April 09, 2006, 01:30:30 am
1. This was a problem when compiling on Windows with the Unix scripts. It's been fixed in CVS. Snapshots here (http://uqm.stack.nl/files/snapshots/).

2. What do you mean by "double than the release"?

3.  If you first compiled without OpenAL support, and later with, you should do a "./build.sh uqm clean" in between. Though just "./build.sh uqm depend" will probably work too, and will be faster.



Title: Re: Some issues compiling with MINGW/MSYS
Post by: Juffo on April 09, 2006, 06:53:40 am
Quote
2. What do you mean by "double than the release"?
The original uqm.exe is 987 kb, the one built with minGW is 1.81 mb and when running doesn't output to console.

Quote
3.  If you first compiled without OpenAL support, and later with, you should do a "./build.sh uqm clean" in between. Though just "./build.sh uqm depend" will probably work too, and will be faster.
Ok, but now there's another problem:
Quote
In file included from src/sc2code/libs/sound/openal/audiodrv_openal.c:23:
src/sc2code/libs/sound/openal/audiodrv_openal.h:31:20: AL/al.h: No such file or directory
src/sc2code/libs/sound/openal/audiodrv_openal.h:32:21: AL/alc.h: No such file or directory
I can see those files are in the OpenAL library folder (.....\OpenAL\Include)
In the source tree, the file libs\sound\openal\audiodrv_openal.h says:

#if defined (__APPLE__)
#   include <OpenAL/al.h>
#   include <OpenAL/alc.h>
#else
#   include <AL/al.h>
#   include <AL/alc.h>
#   ifdef _MSC_VER
#      pragma comment (lib, "OpenAL32.lib")
#   endif
#endif

EDIT: solved by copying the needed files in the same folder of build.sh


Title: Re: Some issues compiling with MINGW/MSYS
Post by: meep-eep on April 09, 2006, 09:35:04 pm
2. I knew that gcc build were larger, but not that they were that much larger. (I'm purely a Linux user myself)
3. Where were those file originally?



Title: Re: Some issues compiling with MINGW/MSYS
Post by: Juffo on April 10, 2006, 06:46:41 pm
They aren't in the source tree at all. (release 0.50)
They are in the OpenAL include folder (e.g. c:\libs\OpenaL\Include) as part of the OpenAL SDK installation.

Quote
The original uqm.exe is 987 kb, the one built with minGW is 1.81 mb and when running doesn't output to console.
Quote
2. I knew that gcc build were larger, but not that they were that much larger. (I'm purely a Linux user myself)
Do I have to modify the source to get the console working?


Title: Re: Some issues compiling with MINGW/MSYS
Post by: meep-eep on April 10, 2006, 07:40:47 pm
The OpenAL libs aren't supposed to be in the UQM source. They are however, supposed to be detected.
The console, you'll only get in debug mode, or if you set '--subsystem=console' in the environment var LDFLAGS before you run the uqm config.


Title: Re: Some issues compiling with MINGW/MSYS
Post by: Novus on April 10, 2006, 08:22:14 pm
The OpenAL libs aren't supposed to be in the UQM source. They are however, supposed to be detected.
Clarification: the libraries are detected if they are installed properly; see the OpenAL SDK documentation for details.


Title: Re: Some issues compiling with MINGW/MSYS
Post by: Juffo on April 10, 2006, 11:36:08 pm
OK, thanks for the answers :)


Title: Re: Some issues compiling with MINGW/MSYS
Post by: fossil on April 24, 2006, 01:43:41 pm
2 - after running build.sh uqm config and setting to optimized release version the file size is 1.81 MB, almost the double than the release. Is the normal behavior of using MinGW?

Yes and no. The cygming special gcc (and ld) has a slightly different behavior than normal gcc. The doubling in size is the result of debug symbols not being stripped from the exe. This can be rectified by supplying --strip-debug or --strip-all flags to ld (or putting these values into LDFLAGS env var, like meep-eep said).
Now the real question is why gcc is producing these symbols in the first place, when no -g option specified.