Hi All,
This is driving me nutso!
I'm merely trying to include the <iostream> header in my source code,
but as soon as I compile it, I get:
Error : identifier '__mbstate_t' redeclared
was declared as: '__mbstate_t'
now declared as: 'int'
(included from:
istream:147
niostream:17
iostream:33
SNSockets.cpp:20)
localeimp line 20 typedef int __mbstate_t;
The offending code in "localeimp" looks like this:
#ifndef _MSL_NO_WCHART_C_SUPPORT
#include <wchar_t.h> // for mbstate_t
#else
typedef int __mbstate_t;
#endif
I have tried (against my better judgement) changing this code to:
#ifndef _MSL_NO_WCHART_C_SUPPORT
#include <wchar_t.h> // for mbstate_t
#else
#ifndef _BSD_MBSTATE_T_DEFINED_
typedef int mbstate_t;
#define _BSD_MBSTATE_T_DEFINED_
#endif
#endif
And although this corrects the compile error, I end up with errors
like:
Link Error : undefined: '__ctype_mapC' (non lazy ptr IL)
Referenced from 'std::ctype<char>::ctype(const std::ctype_base::mask*,
__bool8, unsigned long)' in MSL_C++_Mach-O.lib
Relevant development environment info:
Developer Tools v1.5
Mac OS X 10.3.6
CodeWarrior 9.2
Has anyone come across a solution to this problem or even the problem
itself?
Thanks for any replies.
Clint Weisbrod.
Horst Bachmann - 29 Nov 2004 17:31 GMT
> Hi All,
>
[quoted text clipped - 51 lines]
>
> Clint Weisbrod.
I had a similiar problem. It had to do with the order of the include
files. In my case I had prototypes where the argument where pointers to
structs. If I included this prototypes before I defined the structs I've
got also this compiler errors.
Cheers, Horst
Howard Hinnant - 29 Nov 2004 18:40 GMT
> Hi All,
>
[quoted text clipped - 49 lines]
>
> Thanks for any replies.
Try starting with the provided Mach-O stationary. This will correctly
set up your access paths to avoid this problem.
-Howard
Clint Weisbrod - 30 Nov 2004 03:34 GMT
> > Hi All,
> >
[quoted text clipped - 54 lines]
>
> -Howard
Thank-you both for the responses. I only wish it were as easy as
starting over with the right included Mach-O stationary.
Unfortunately, this project is huge and it is not feasable to recreate
the project.
I did try creating a new project using the Mach-O stationary and
re-arranged my system access paths to match the order in the Mach-O
stationary project. My system access paths now look like this:
(Compiler)MSL/MSL_C
(Compiler)MSL/MSL_C++
(Compiler)MacOS X Support
(OS X Volume)usr/include
(OS X Volume)usr/lib
(OS X Volume)System/Library/Frameworks
However, I keep getting the following type of error:
Error : preprocessor #error directive
(included from:
CoreFoundation/CFBase.h:12
CoreFoundation/CoreFoundation.h:8
CarbonCore/CarbonCore.h:20
CoreServices/CoreServices.h:21
Carbon.h:20
PP_ClassHeaders.cpp:13
Mac (Debug).pch++:27)
stdint.h line 18 #error You must have the non-MSL C header file
access path before the MSL access path
OK, so I do as the error says and change the access paths to:
(OS X Volume)usr/include
(OS X Volume)usr/lib
(Compiler)MSL/MSL_C
(Compiler)MSL/MSL_C++
(Compiler)MacOS X Support
(OS X Volume)System/Library/Frameworks
And I'm back to this error:
Error : identifier 'mbstate_t' redeclared
was declared as: '__mbstate_t'
now declared as: 'int'
(included from:
string:359
LString.h:18
LPane.h:15
PP_ClassHeaders.cpp:23
Mac (Debug).pch++:27)
iosfwd line 28 typedef int mbstate_t;
ARRRRGGGGGH!
I'm pretty new to Mac development and CodeWarrior. Can somebody
explain what the purpose of the "Access Paths" are for? Is it intended
to define a search order #include'd header files? And if so, I would
think that just including headers in the wrong order in my source code
could cause the grief I'm currently experiencing. If that is the case,
then can anyone explain exactly what I need to ensure in terms of what
order headers are included in source files?
Thanks very much.
Clint Weisbrod.
Josef W. Wankerl - 30 Nov 2004 15:55 GMT
> I did try creating a new project using the Mach-O stationary and
> re-arranged my system access paths to match the order in the Mach-O
[quoted text clipped - 20 lines]
> stdint.h line 18 #error You must have the non-MSL C header file
> access path before the MSL access path
When you have MSL first in your access paths, you must also put #include
<MSLCarbonPrefix.h> in your preprocessor panel. Or you can define some
of the symbols that MSLCarbonPrefix.h does manually. Usually it's
easier to just include that file.
MW Ron - 30 Nov 2004 20:35 GMT
Hi Clint,
I'll work with you on this off line. You are mixing BSD C lib and
PowerPlant and MSL C++ and there is some problems due to that non normal
usage.
Ron
>> > Hi All,
>> >
[quoted text clipped - 120 lines]
>
>Clint Weisbrod.

Signature
Metrowerks Community Forum is a free online resource for developers
to discuss CodeWarrior topics with other users and Metrowerks' staff
-- http://www.metrowerks.com/community --
Ron Liechty - MWRon@metrowerks.com - http://www.metrowerks.com
MW Ron - 30 Nov 2004 02:45 GMT
>Hi All,
>
>This is driving me nutso!
Please check your access paths and be sure that you do not have the
recursive search on for the include (and lib) paths, generally that is
the problem. The other reasons would be you didn't rebuild the
precompiled headers after updating or you have the wrong prefix file.
Ron
>I'm merely trying to include the <iostream> header in my source code,
>but as soon as I compile it, I get:
[quoted text clipped - 47 lines]
>
>Clint Weisbrod.

Signature
Metrowerks Community Forum is a free online resource for developers
to discuss CodeWarrior topics with other users and Metrowerks' staff
-- http://www.metrowerks.com/community --
Ron Liechty - MWRon@metrowerks.com - http://www.metrowerks.com