Error Building 578 (flac???)

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
Lemonzest
Posts: 327
Joined: Tue Oct 12, 2004 3:19 pm
Location: On your boards, trolling your threads!!!

Error Building 578 (flac???)

Post by Lemonzest »

Hi

Tried building this moring and this is the error i'm getting.

Code: Select all

Compiling stream_decoder.c:                                           [ERROR]
gcc -D__MINW32__ -DWIN32 -DNDEBUG -D_LIB -DFLAC__CPU_IA32 -DFLAC_HAS_NASM -DFLAC
__SSE_OS -DFLAC__USE_3DNOW -DFLAC__NO_DLL -I. -O2 -Wall -Wno-unused-function -fo
mit-frame-pointer -c -o stream_decoder.o stream_decoder.c
================================================================================
In file included from stream_decoder.c:57:
share/alloc.h:41:5: #error
In file included from stream_decoder.c:57:
share/alloc.h: In function `safe_malloc_mul_2op_':
share/alloc.h:120: error: `SIZE_T_MAX' undeclared (first use in this function)
share/alloc.h:120: error: (Each undeclared identifier is reported only once
share/alloc.h:120: error: for each function it appears in.)
share/alloc.h: In function `safe_malloc_mul_3op_':
share/alloc.h:130: error: `SIZE_T_MAX' undeclared (first use in this function)
share/alloc.h: In function `safe_malloc_mul2add_':
share/alloc.h:143: error: `SIZE_T_MAX' undeclared (first use in this function)
share/alloc.h: In function `safe_realloc_mul_2op_':
share/alloc.h:196: error: `SIZE_T_MAX' undeclared (first use in this function)
mingw32-make[1]: *** [stream_decoder.o] Error 1
mingw32-make[1]: Leaving directory `C:/zdoom/trunk/flac'
mingw32-make: *** [basetools] Error 2
Thanks.
User avatar
Siggi
Posts: 3288
Joined: Sun Oct 03, 2004 8:57 am
Preferred Pronouns: They/Them
Location: South Africa

Re: Error Building 578 (flac???)

Post by Siggi »

I'm not having any trouble building on Ubuntu with r578.
Lemonzest
Posts: 327
Joined: Tue Oct 12, 2004 3:19 pm
Location: On your boards, trolling your threads!!!

Re: Error Building 578 (flac???)

Post by Lemonzest »

thats because linux does not use the bundled version of FLAC, its only used on Windows. mingw gcc does not always like the same things ms vcc does :blergh:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49053
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Error Building 578 (flac???)

Post by Graf Zahl »

... and it wouldn't be the first time that MinGW uses incomplete Windows headers...
Lemonzest
Posts: 327
Joined: Tue Oct 12, 2004 3:19 pm
Location: On your boards, trolling your threads!!!

Re: Error Building 578 (flac???)

Post by Lemonzest »

any idea what i need to add??

edit: found this, added to limits.h

#define SIZE_T_MAX UINT_MAX /* max value for a size_t */

unsure of where i needed to add it i stuck it to the end, its compiling now :D

some help and maybe a more detailed fix would be nice.

edit2: problem linking :(

Code: Select all

================================================================================
flac/libflac.a(stream_decoder.o):stream_decoder.c:(.text+0x467): undefined refer
ence to `_FLAC__MD5Final'
flac/libflac.a(stream_decoder.o):stream_decoder.c:(.text+0x9ea): undefined refer
ence to `_FLAC__MD5Init'
flac/libflac.a(stream_decoder.o):stream_decoder.c:(.text+0x365e): undefined refe
rence to `_FLAC__MD5Accumulate'
collect2: ld returned 1 exit status
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: Error Building 578 (flac???)

Post by randi »

Just so you know, I made sure the library would still build with mingw before I committed the update, and it worked fine for me. I didn't need to touch any header files.

Here's what my output looks like:

Code: Select all

C:\zdoom\trunk\FLAC>mingw32-make -f makefile.mgw
Assembling cpu_asm.nasm:                                              [OK]
Assembling fixed_asm.nasm:                                            [OK]
Assembling lpc_asm.nasm:                                              [OK]
Compiling bitmath.c:                                                  [OK]
Compiling bitreader.c:                                                [OK]
Compiling cpu.c:                                                      [OK]
Compiling crc.c:                                                      [OK]
Compiling fixed.c:                                                    [OK]
Compiling format.c:                                                   [OK]
Compiling lpc.c:                                                      [OK]
Compiling md5.c:                                                      [OK]
Compiling memory.c:                                                   [OK]
Compiling stream_decoder.c:                                           [OK]
Compiling stream_decoder_pp.cpp:                                      [OK]
Creating library libflac.a:                                           [OK]
However, I did notice that when I changed the makefile.mgw, I wrote "md5.c" where I should have written "md5.o", so it wasn't including the md5 code in the library.
Lemonzest
Posts: 327
Joined: Tue Oct 12, 2004 3:19 pm
Location: On your boards, trolling your threads!!!

Re: Error Building 578 (flac???)

Post by Lemonzest »

Its compiling and linking now with the modified limits.h header. thanks for your help. :P have one of these (_)3

Lemonzest.
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: Error Building 578 (flac???)

Post by randi »

Now that I think about it, the reason I had no trouble with SIZE_T_MAX is probably because I built myself a copy of GCC 4.2.1 some time ago instead of using the ancient version of GCC 3 that mingw still lists as current.
Lemonzest
Posts: 327
Joined: Tue Oct 12, 2004 3:19 pm
Location: On your boards, trolling your threads!!!

Re: Error Building 578 (flac???)

Post by Lemonzest »

yeah i need to install GCC 4.2.1 again, only went back to 3.4.5 because of odamex problems. but thanks for the hint :)

edit: just installed gcc 4.2.1 from mingw site, and still need the line added to limits.h ah well it builds :)

in alloc.h in the FLAC project, there's this which i think is defining SIZE_T_MAX for ms vc and mabe it needs something for gcc?

#ifndef SIZE_MAX
# ifndef SIZE_T_MAX
# ifdef _MSC_VER
# define SIZE_T_MAX UINT_MAX
# else
# error
# endif
# endif
# define SIZE_MAX SIZE_T_MAX
#endif
Post Reply

Return to “Closed Bugs [GZDoom]”