Redefinition Error

bridged with qdn.public.qnxrtp.devtools
Post Reply
Robert Regos

Redefinition Error

Post by Robert Regos » Tue Jan 28, 2003 3:27 pm

Hello,

I am trying to port some software to QNX. I can compile most of the
components of the project.
However some I cannot, no mater what I do. I allways get "_Mbstatet" and
"_Fpost" redefinition errors.

As far as I can see _Mbstatet and _Fpost are defined in the folowing files:
once in /usr/include/sys/platform.h

#ifdef __MBSTATE_T
typedef __MBSTATE_T _Mbstatet;
#undef __MBSTATE_T
#define __MBSTATE_T _Mbstatet
#endif

/* _Fpost must be after _Offt and _Off64t */
#ifdef __FPOS_T
typedef __FPOS_T _Fpost;
#undef __FPOS_T
#define __FPOS_T _Fpost
#endif


and then again in /usr/include/sys/platform_nto.h

#undef __MBSTATE_T
#define __MBSTATE_T \
struct _Mbstatet { /* state of a multibyte translation */ \
_Wchart _Wchar; \
char _State; \
char _Reserved[3]; \
}

#undef __FPOS_T
#define __FPOS_T \
struct _Fpost { /* file position */ \
_Off64t _Off; \
_Mbstatet _Wstate; \
}


Under Linux I can compile using STLPort-4.5.3.
On QNX I compile using the STL that comes with QNX.
I am using QNX Neutrino 6.2 with Photon GUI.
I have included below the optput from make.

So what can I do in order to get rid of these errors? Any sugestion welcome.
Thanks,

Robert Regos



bash-2.05a# make -k
source='GeoMoleculeImpl.cpp' object='GeoMoleculeImpl.o' libtool=no \
depfile='.deps/GeoMoleculeImpl.Po' tmpdepfile='.deps/GeoMoleculeImpl.TPo' \
depmode=gcc /bin/sh ../../depcomp \
g++ -DHAVE_CONFIG_H -I. -I. -I../.. -Wall -Wno-switch -Wno-ctor-dtor-priva
cy -Wno-non-virtual-dtor -Wno-unknown-pragmas -Wno-unused
-Wno-sign-compare -fexceptions -funsigned-char -fno-for-scope -I/usr/include
/g++-3 -I/usr/ntox86/include -I/usr/lib/gcc-lib/ntox86/2.95.3/include
-I../../../BasicComp -I../../../BasicComp/UsefulCode -DNDEBUG -O2 -ITa
bles -c -o GeoMoleculeImpl.o `test -f 'GeoMoleculeImpl.cpp' || echo
'./'`GeoMoleculeImpl.cpp
In file included from /usr/include/wchar.h:15,
from ../../../BasicComp/UsefulCode/StrProxy.h:6,
from GeoMoleculeImpl.h:9,
from GeoMoleculeImpl.cpp:3:
/usr/include/sys/platform.h:239: redefinition of `struct _Mbstatet'
/usr/include/sys/platform.h:239: previous definition here
/usr/include/sys/platform.h:258: redefinition of `struct _Fpost'
/usr/include/sys/platform.h:258: previous definition here
make: *** [GeoMoleculeImpl.o] Error 1

g -DHAVE_CONFIG_H -I. -I. -I../.. -Wall -Wno-switch -Wno-ctor-dtor-privacy
-Wno-non-virtual-dtor -Wno-unknown-pragmas -Wno-unused -Wno-si
gn-compare -fexceptions -funsigned-char -fno-for-scope -I/usr/include/g3 -I/
usr/ntox86/include -I/usr/lib/gcc-lib/ntox86/2.95.3/include -I
.../../../BasicComp -I../../../BasicComp/UsefulCode -DNDEBUG -O2 -c
-o TMCTables.o `test -f './TMCTables.cpp' || echo './'`./TMCTable
s.cpp
In file included from /usr/include/dirent.h:15,
from ../../UsefulCode/FindFile/FindFile.h:62,
from ./TMCTables.cpp:9:
/usr/include/sys/platform.h:239: redefinition of `struct _Mbstatet'
/usr/include/sys/platform.h:239: previous definition here
/usr/include/sys/platform.h:258: redefinition of `struct _Fpost'
/usr/include/sys/platform.h:258: previous definition here
make: *** [TMCTables.o] Error 1
make: Target `all' not remade because of errors.

Post Reply

Return to “qdn.public.qnxrtp.devtools”