Menu

#135 faac-1.26 with msys+mingw, conflicting declaration

closed-accepted
nobody
None
5
2008-04-06
2008-03-02
Elio Blanca
No

Building faac (./configure --disable-shared --with-mp4v2) i got this conflicting declaration error when compiling /common/mp4v2/3gp.cpp:

/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I/usr/local/include -Wall -O4 -MT 3gp.lo -MD -MP -MF .deps/3gp.Tpo -c -o 3gp.lo 3gp.cpp
g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I/usr/local/include -Wall -O4 -MT 3gp.lo -MD -MP -MF .deps/3gp.Tpo -c 3gp.cpp -o 3gp.o
In file included from mp4common.h:29,
from 3gp.cpp:28:
mpeg4ip.h:74: error: conflicting declaration 'typedef int ssize_t'
d:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/types.h:104: error: 'ssize_t' has a previous declaration as `typedef _ssize_t ssize_t'
mpeg4ip.h:74: error: declaration of `typedef int ssize_t'
d:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/types.h:104: error: conflicts with previous declaration `typedef _ssize_t ssize_t'
mpeg4ip.h:74: error: declaration of `typedef int ssize_t'
d:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/types.h:104: error: conflicts with previous declaration `typedef _ssize_t ssize_t'

Now, in mpeg4ip.h i can read
typedef int ssize_t;
and into /include/sys/types.h
#ifndef _SSIZE_T_
#define _SSIZE_T_
typedef long _ssize_t;
#ifndef _NO_OLDNAMES
typedef _ssize_t ssize_t;
#endif
#endif /* Not _SSIZE_T_ */

So, mpeg4ip.h wants ssize_t to be an int, when types.h wants it to be a long. Which one is the right type?

Discussion

  • Elio Blanca

    Elio Blanca - 2008-04-03

    Logged In: YES
    user_id=666181
    Originator: YES

    Fixed.
    I wrote a patch which lets faac-1.26 build flawlessly under msys+mingw too (and the patch was tested under ubuntu too, it doesn't hurt!). This patch fixes some conflicting/missing declarations and can be used as-is but checking again the new declaration for the macros VAR_TO_FPOS and FPOS_TO_VAR (look at the diff file) may be a good idea; i mean, the code works but the preprocessor directives may be more clear/elegant, i think.

    BTW, i see the different encodings LC/Main/LTP were disabled, so why the long help wasn't modified (the users can still read the option), will these appear again in future releases?
    File Added: faac-1.26-mingw.diff

     
  • Elio Blanca

    Elio Blanca - 2008-04-03

    patch for building faac-1.26 under msys+mingw

     
  • menno

    menno - 2008-04-06

    Logged In: YES
    user_id=1853
    Originator: NO

    Applied patch. Thanks!

     
  • menno

    menno - 2008-04-06
    • status: open --> closed-accepted
     

Log in to post a comment.

MongoDB Logo MongoDB