You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@stdcxx.apache.org by Martin Sebor <se...@roguewave.com> on 2006/11/15 17:12:19 UTC

Re: stdcxx compilation failed with VC8 option Non (/Zc:wchar_t-)

Nadine Faizant wrote:
>  
>     Hello Martin,
>  
>     First i'm using directly your email @ because (I don't know I do not 
> receive mail from stdcxx-user@incubator.apache.org 
> <ma...@incubator.apache.org> 
> <stdcxx-user@incubator.apache.org 
> <ma...@incubator.apache.org>> response and you are only 
> responding to my question via stdcxx-user mailing...).

You need to subscribe to the list in order to receive emails
from it (see http://incubator.apache.org/stdcxx/#lists). To
subscribe, simply send a blank email to
stdcxx-user-subscribe@incubator.apache.org. Either I or one
of the other stdcxx developers or even users will be happy
to help you with the issues you are running into there. It's
important to keep the discussions on the list so that they
can be archived for future reference.

Martin

>  
>     I run into a new problem.
>  
>     I have to compile xerces + xalan project with stdcxx. For 
> xalan-xerces compatibility I have to use on VC 8 option : c++/language/ 
> "wchar_t as integrated type" option Non (/Zc:wchar_t-)
>  
>  
>     If I choose this option on xalan compilation with a stdcxx I have 
> this compilation error :
>  
> 1>d:\NPTE\dev\src\cpp\externals\win32\include\rw/_select.h(78) : error 
> C2766: spécialisation explicite ; '__rw::__rw_select_int<unsigned 
> short>' a déjà été défini
> 
> 1> d:\NPTE\dev\src\cpp\externals\win32\include\rw/_select.h(66) : voir 
> la définition précédente de '__rw_select_int<unsigned short>'
> 
>  
>     So i decided to compile stdcxx with the same option Non (/Zc:wchar_t-)
>    
>  
>     Then i encoutered a new problem on stdcxx compilation, while 
> compiling rwtest project :
>    
> 
> 1>any.cpp
> 
> 1>D:\dev\stl\stdcxx-4.1.3\tests\include\any.h(66) : error C2535: 
> 'rw_any_t::rw_any_t(unsigned short)' : fonction membre déjà définie ou 
> déclarée
> 
> 1> D:\dev\stl\stdcxx-4.1.3\tests\include\any.h(42) : voir la déclaration 
> de 'rw_any_t::rw_any_t'
> 
> 1>..\..\..\stdcxx-4.1.3\tests\src\any.cpp(188) : error C2084: la 
> fonction 'rw_any_t::rw_any_t(unsigned short)' a déjà un corps
> 
> 1> D:\dev\stl\stdcxx-4.1.3\tests\include\any.h(42) : voir la définition 
> précédente de '{ctor}'
> 
>  
>     What shalI do ?
>  
>     Thanks,
>  
> ------------------------------------------------------------------------
> <>*Nadine Faizant*
> *NewPhenix*
> Z.A. - 5, Rue de l'Auberte
> 30 133 Les Angles
> 
> Tél : 04 90 26 74 82
> Fax : 04 90 26 90 84
> Courriel : nadine.faizant@nautitia.fr <ma...@nautitia.fr>
> ------------------------------------------------------------------------


Re: stdcxx compilation failed with VC8 option Non (/Zc:wchar_t-)

Posted by Martin Sebor <se...@roguewave.com>.
Nadine Faizant wrote:
> OK, thanks Martin, it's too much work to change option of all gnu libray 
> I'm using....I couldn't do that...

Of course, and you shouldn't have to do that (and you don't :)

> So I stop this try. Just for your information, I could'nt succed to 
> compile stdcxx with (/Zc:wchar_t-) option

It should be (and I believe it is) possible to compile stdcxx
either way, just as long as it's configured correctly. Why don't
you post your config.h header (the header generated by the stdcxx
configuration infrastructure) along with the compiler command line
that you used to compile the library as well as the file that's
giving you trouble. I'm quite confident we can figure out how to
get it to compile.

Martin

> 
>    Nadine
> 
> ----- Original Message ----- From: "Martin Sebor" <se...@roguewave.com>
> To: "Nadine Faizant" <na...@nautitia.fr>
> Cc: <st...@incubator.apache.org>
> Sent: Wednesday, November 15, 2006 6:42 PM
> Subject: Re: stdcxx compilation failed with VC8 option Non (/Zc:wchar_t-)
> 
> 
>> Nadine Faizant wrote:
>>
>>> I received twice this mail :-)... Now it's work...
>>> End of joke...
>>>
>>> I'm trying to change the description of my problem to understand what 
>>> you say... i'm very bad with this kind of problem...
>>>
>>> could I use or does this should work ?
>>>
>>> stdcxx with option yes for wchar_t as integrated type, no more macro
>>> +
>>> xalan with option no (/Zc:wchar_t-) ???
>>
>>
>> All C++ code in the same program (i.e., all C++ libraries as well
>> as the executable program itself) must be compiled with compatible
>> command line options. When using stdcxx you cannot mix and match
>> object files or libraries compiled with different settings of the
>> /Zc:wchar_t option.
>>
>>>
>>> That's what I do, and don't work...
>>>
>>> I understand i must not use _RWSTD_NO_NATIVE_WCHAR_T... Right ?
>>
>>
>> It's not that you shouldn't use the macro. You need to make sure
>> the macro is always defined (or undefined) to correspond to the
>> setting of the /Zc:wchar_t option, and that its definition is
>> the same in each translation unit in a program. If you configure
>> and compile the library with wchar_t enabled (i.e., when it's
>> a distinct C++ type) you need to also compile all other C++
>> libraries as well as your program with wchar_t enabled.
>>
>> Since it's possible for other configuration macros (i.e., those
>> whose name starts with the _RWSTD_NO_ prefix) to depend on the
>> the definition of _RWSTD_NO_NATIVE_WCHAR_T the only way to be
>> sure you are using a properly configured library is to rerun
>> all the configuration tests after changing a compiler option.
>>
>>>
>>> Thanks again,
>>>
>>>        Nadine
>>>
>>> PS : I prefer RW product, I do not have so much compilation problem :-((
>>
>>
>> The source code in the Rogue Wave C++ Standard Library is the
>> same as Apache stdcxx. The only thing that's different is the
>> configuration infrastructure and that's going to change in the
>> next release of SourcePro to use the stdcxx configuration
>> mechanism. It's much more robust, light weight, portable, and
>> infinitely easier to work with and maintain. In addition, the
>> configuration results are more reliable with it than with the
>> SourcePro configuration system.
>>
>> Martin
>>
> 
> 


Re: stdcxx compilation failed with VC8 option Non (/Zc:wchar_t-)

Posted by Nadine Faizant <na...@nautitia.fr>.
OK, thanks Martin, it's too much work to change option of all gnu libray I'm 
using....I couldn't do that...
So I stop this try. Just for your information, I could'nt succed to compile 
stdcxx with (/Zc:wchar_t-) option

    Nadine

----- Original Message ----- 
From: "Martin Sebor" <se...@roguewave.com>
To: "Nadine Faizant" <na...@nautitia.fr>
Cc: <st...@incubator.apache.org>
Sent: Wednesday, November 15, 2006 6:42 PM
Subject: Re: stdcxx compilation failed with VC8 option Non (/Zc:wchar_t-)


> Nadine Faizant wrote:
>> I received twice this mail :-)... Now it's work...
>> End of joke...
>>
>> I'm trying to change the description of my problem to understand what you 
>> say... i'm very bad with this kind of problem...
>>
>> could I use or does this should work ?
>>
>> stdcxx with option yes for wchar_t as integrated type, no more macro
>> +
>> xalan with option no (/Zc:wchar_t-) ???
>
> All C++ code in the same program (i.e., all C++ libraries as well
> as the executable program itself) must be compiled with compatible
> command line options. When using stdcxx you cannot mix and match
> object files or libraries compiled with different settings of the
> /Zc:wchar_t option.
>
>>
>> That's what I do, and don't work...
>>
>> I understand i must not use _RWSTD_NO_NATIVE_WCHAR_T... Right ?
>
> It's not that you shouldn't use the macro. You need to make sure
> the macro is always defined (or undefined) to correspond to the
> setting of the /Zc:wchar_t option, and that its definition is
> the same in each translation unit in a program. If you configure
> and compile the library with wchar_t enabled (i.e., when it's
> a distinct C++ type) you need to also compile all other C++
> libraries as well as your program with wchar_t enabled.
>
> Since it's possible for other configuration macros (i.e., those
> whose name starts with the _RWSTD_NO_ prefix) to depend on the
> the definition of _RWSTD_NO_NATIVE_WCHAR_T the only way to be
> sure you are using a properly configured library is to rerun
> all the configuration tests after changing a compiler option.
>
>>
>> Thanks again,
>>
>>        Nadine
>>
>> PS : I prefer RW product, I do not have so much compilation problem :-((
>
> The source code in the Rogue Wave C++ Standard Library is the
> same as Apache stdcxx. The only thing that's different is the
> configuration infrastructure and that's going to change in the
> next release of SourcePro to use the stdcxx configuration
> mechanism. It's much more robust, light weight, portable, and
> infinitely easier to work with and maintain. In addition, the
> configuration results are more reliable with it than with the
> SourcePro configuration system.
>
> Martin
> 



Re: stdcxx compilation failed with VC8 option Non (/Zc:wchar_t-)

Posted by Martin Sebor <se...@roguewave.com>.
Nadine Faizant wrote:
> I received twice this mail :-)... Now it's work...
> End of joke...
> 
> I'm trying to change the description of my problem to understand what 
> you say... i'm very bad with this kind of problem...
> 
> could I use or does this should work ?
> 
> stdcxx with option yes for wchar_t as integrated type, no more macro
> +
> xalan with option no (/Zc:wchar_t-) ???

All C++ code in the same program (i.e., all C++ libraries as well
as the executable program itself) must be compiled with compatible
command line options. When using stdcxx you cannot mix and match
object files or libraries compiled with different settings of the
/Zc:wchar_t option.

> 
> That's what I do, and don't work...
> 
> I understand i must not use _RWSTD_NO_NATIVE_WCHAR_T... Right ?

It's not that you shouldn't use the macro. You need to make sure
the macro is always defined (or undefined) to correspond to the
setting of the /Zc:wchar_t option, and that its definition is
the same in each translation unit in a program. If you configure
and compile the library with wchar_t enabled (i.e., when it's
a distinct C++ type) you need to also compile all other C++
libraries as well as your program with wchar_t enabled.

Since it's possible for other configuration macros (i.e., those
whose name starts with the _RWSTD_NO_ prefix) to depend on the
the definition of _RWSTD_NO_NATIVE_WCHAR_T the only way to be
sure you are using a properly configured library is to rerun
all the configuration tests after changing a compiler option.

> 
> Thanks again,
> 
>        Nadine
> 
> PS : I prefer RW product, I do not have so much compilation problem :-((

The source code in the Rogue Wave C++ Standard Library is the
same as Apache stdcxx. The only thing that's different is the
configuration infrastructure and that's going to change in the
next release of SourcePro to use the stdcxx configuration
mechanism. It's much more robust, light weight, portable, and
infinitely easier to work with and maintain. In addition, the
configuration results are more reliable with it than with the
SourcePro configuration system.

Martin

Re: stdcxx compilation failed with VC8 option Non (/Zc:wchar_t-)

Posted by Martin Sebor <se...@roguewave.com>.
Martin Sebor wrote:
[...]
>>     I have to compile xerces + xalan project with stdcxx. For 
>> xalan-xerces compatibility I have to use on VC 8 option : 
>> c++/language/ "wchar_t as integrated type" option Non (/Zc:wchar_t-)
>>  
>>  
>>     If I choose this option on xalan compilation with a stdcxx I have 
>> this compilation error :
>>  
>> 1>d:\NPTE\dev\src\cpp\externals\win32\include\rw/_select.h(78) : error 
>> C2766: spécialisation explicite ; '__rw::__rw_select_int<unsigned 
>> short>' a déjà été défini

The explicit specialization on this line is guarded with the
_RWSTD_NO_NATIVE_WCHAR_T configuration macro. The macro is
#defined when wchar_t is detected not to be a distinct type
(i.e., when it's a typedef for one of the other C++ types).

The error message suggests that you are compiling the header
with a different setting of the /Zc:wchar_t option that what
you used to configure the library. Since this is option
affects the binary compatibility of the code generated by the
compiler you must use the same setting consistently.

>>
>> 1> d:\NPTE\dev\src\cpp\externals\win32\include\rw/_select.h(66) : voir 
>> la définition précédente de '__rw_select_int<unsigned short>'
>>
>>  
>>     So i decided to compile stdcxx with the same option Non 
>> (/Zc:wchar_t-)
>>     
>>     Then i encoutered a new problem on stdcxx compilation, while 
>> compiling rwtest project :

This looks like another symptom of the same problem. Make sure
you reconfigure the library each time you change the setting of
the option.

Martin

>>   
>> 1>any.cpp
>>
>> 1>D:\dev\stl\stdcxx-4.1.3\tests\include\any.h(66) : error C2535: 
>> 'rw_any_t::rw_any_t(unsigned short)' : fonction membre déjà définie ou 
>> déclarée
>>
>> 1> D:\dev\stl\stdcxx-4.1.3\tests\include\any.h(42) : voir la 
>> déclaration de 'rw_any_t::rw_any_t'
>>
>> 1>..\..\..\stdcxx-4.1.3\tests\src\any.cpp(188) : error C2084: la 
>> fonction 'rw_any_t::rw_any_t(unsigned short)' a déjà un corps
>>
>> 1> D:\dev\stl\stdcxx-4.1.3\tests\include\any.h(42) : voir la 
>> définition précédente de '{ctor}'
>>
>>  
>>     What shalI do ?
>>  
>>     Thanks,
>>  
>> ------------------------------------------------------------------------
>> <>*Nadine Faizant*
>> *NewPhenix*
>> Z.A. - 5, Rue de l'Auberte
>> 30 133 Les Angles
>>
>> Tél : 04 90 26 74 82
>> Fax : 04 90 26 90 84
>> Courriel : nadine.faizant@nautitia.fr <ma...@nautitia.fr>
>> ------------------------------------------------------------------------
> 
>