[Fixed] Error Building 578 (flac???)

Bugs that have been investigated and resolved somehow.

Moderators: Developers, ZDoom.org Team

Error Building 578 (flac???)

Postby Lemonzest » Thu Dec 06, 2007 7:34 am

Hi

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

Code: Select allExpand view
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.
Lemonzest
 
Joined: 12 Oct 2004
Location: On your boards, trolling your threads!!!

Re: Error Building 578 (flac???)

Postby Siggi » Thu Dec 06, 2007 8:22 am

I'm not having any trouble building on Ubuntu with r578.
User avatar
Siggi
 
Joined: 03 Oct 2004
Location: South Africa

Re: Error Building 578 (flac???)

Postby Lemonzest » Thu Dec 06, 2007 9:20 am

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:
Lemonzest
 
Joined: 12 Oct 2004
Location: On your boards, trolling your threads!!!

Re: Error Building 578 (flac???)

Postby Graf Zahl » Thu Dec 06, 2007 9:28 am

... and it wouldn't be the first time that MinGW uses incomplete Windows headers...
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Error Building 578 (flac???)

Postby Lemonzest » Thu Dec 06, 2007 9:37 am

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 allExpand view
================================================================================
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
Lemonzest
 
Joined: 12 Oct 2004
Location: On your boards, trolling your threads!!!

Re: Error Building 578 (flac???)

Postby randi » Thu Dec 06, 2007 12:33 pm

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 allExpand view
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.
User avatar
randi
Site Admin
 
Joined: 09 Jul 2003

Re: Error Building 578 (flac???)

Postby Lemonzest » Thu Dec 06, 2007 12:52 pm

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

Lemonzest.
Lemonzest
 
Joined: 12 Oct 2004
Location: On your boards, trolling your threads!!!

Re: Error Building 578 (flac???)

Postby randi » Thu Dec 06, 2007 1:04 pm

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.
User avatar
randi
Site Admin
 
Joined: 09 Jul 2003

Re: Error Building 578 (flac???)

Postby Lemonzest » Thu Dec 06, 2007 1:54 pm

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
Lemonzest
 
Joined: 12 Oct 2004
Location: On your boards, trolling your threads!!!


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest