Discussion:
[omniORB] OmniOrb incompatible with Boost library
David Bertrand
2008-06-04 22:08:12 UTC
Permalink
Hi,

Background
MSVC7 libraries compiled with -Zc:wchar_t switch (Treat wchar_t as
Built-in Type) are incompatible with the ones compiled without. This
basically changes the compiler interpretation of wchar_t from unsigned
short to a native wchar_t. Everything go fine until you link to unicode
functions. Since it's a global compile setting, your application cannot
mix and match libraries compiled with different setting : it will give
you link errors.

Boost v1.35 library uses the -Zc:wchar_t switch, and OmniOrb do not use
it. Since MSVC8 activates the -Zc:wchar_t switch by default, I feel it
confirms Boost is right. For testing purposes, I added the switch to
current release.

Here are the changes required for omniorb-4.1.2 :

\mk\platforms\x86_win32_vs_7.mk line 31
Enables "Treat wchar_t as Built-in Type" (-Zc:wchar_t).

MSVC_DLL_CXXNODEBUGFLAGS = -MD -EHs -GS -GR -Zi -nologo
-Zc:wchar_t
MSVC_DLL_CXXLINKNODEBUGOPTIONS = -nologo -DEBUG
MSVC_DLL_CNODEBUGFLAGS = -MD -GS -GR -Zi -nologo -Zc:wchar_t
MSVC_DLL_CLINKNODEBUGOPTIONS = -nologo -DEBUG
#
MSVC_DLL_CXXDEBUGFLAGS = -MDd -EHs -RTC1 -GS -GR -Zi -nologo
-Zc:wchar_t
MSVC_DLL_CXXLINKDEBUGOPTIONS = -nologo -DEBUG
MSVC_DLL_CDEBUGFLAGS = -MDd -RTC1 -GS -GR -Zi -nologo
-Zc:wchar_t
MSVC_DLL_CLINKDEBUGOPTIONS = -nologo -DEBUG
#
# Or
#
# Use the following set of flags to build and use multithread static
libraries
#
MSVC_STATICLIB_CXXNODEBUGFLAGS = -MT -EHs -GS -GR -Zi -nologo
-Zc:wchar_t
MSVC_STATICLIB_CXXLINKNODEBUGOPTIONS = -nologo -DEBUG
MSVC_STATICLIB_CNODEBUGFLAGS = -MT -GS -GR -Zi -nologo
-Zc:wchar_t
MSVC_STATICLIB_CLINKNODEBUGOPTIONS = -nologo -DEBUG

MSVC_STATICLIB_CXXDEBUGFLAGS = -MTd -EHs -RTC1 -GS -GR -Zi
-nologo -Zc:wchar_t
MSVC_STATICLIB_CXXLINKDEBUGOPTIONS = -nologo -DEBUG
MSVC_STATICLIB_CDEBUGFLAGS = -MTd -RTC1 -GS -GR -Zi -nologo
-Zc:wchar_t
MSVC_STATICLIB_CLINKDEBUGOPTIONS = -nologo -DEBUG

My version compiled with this change linked and ran fine.
Feel free to comment.

Thanks,

David

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080604/85da6dd3/attachment.htm
Martin Trappel
2008-06-05 01:10:57 UTC
Permalink
Hi,
_Background_
MSVC7 libraries compiled with -Zc:wchar_t switch (Treat wchar_t as
Built-in Type) are incompatible with the ones compiled without. This
basically changes the compiler interpretation of wchar_t from unsigned
short to a native wchar_t. Everything go fine until you link to unicode
functions. Since it's a global compile setting, your application cannot
mix and match libraries compiled with different setting : it will give
you link errors.
Boost v1.35 library uses the -Zc:wchar_t switch, and OmniOrb do not
use it. Since MSVC8 activates the -Zc:wchar_t switch by default, I feel
it confirms Boost is right. For testing purposes, I added the switch to
current release.
(...)
My version compiled with this change linked and ran fine.
Feel free to comment.
Am I right to say that as long as one does not use Unicode together with
CORBA one does not has to care as all omniORB interfaces will be with
char anyway ... ?

-Martin
David Bertrand
2008-06-05 01:13:43 UTC
Permalink
Post by Martin Trappel
Am I right to say that as long as one does not use Unicode together
with CORBA one does not has to care as all omniORB interfaces will be
with char anyway ... ?
That's correct. If you stay away from unicode, issue will never show up.

-David

-----Original Message-----
From: Martin Trappel [mailto:***@gmx.at]
Sent: June 4, 2008 3:11 PM
To: David Bertrand
Cc: omniorb-***@omniorb-support.com
Subject: Re: [omniORB] OmniOrb incompatible with Boost library
Post by Martin Trappel
Hi,
_Background_
MSVC7 libraries compiled with -Zc:wchar_t switch (Treat wchar_t as
Built-in Type) are incompatible with the ones compiled without. This
basically changes the compiler interpretation of wchar_t from unsigned
short to a native wchar_t. Everything go fine until you link to unicode
functions. Since it's a global compile setting, your application cannot
mix and match libraries compiled with different setting : it will give
you link errors.
Post by Martin Trappel
Boost v1.35 library uses the -Zc:wchar_t switch, and OmniOrb do not
use it. Since MSVC8 activates the -Zc:wchar_t switch by default, I feel
it confirms Boost is right. For testing purposes, I added the switch to
current release.
Post by Martin Trappel
(...)
My version compiled with this change linked and ran fine.
Feel free to comment.
Am I right to say that as long as one does not use Unicode together with
CORBA one does not has to care as all omniORB interfaces will be with
char anyway ... ?

-Martin


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Duncan Grisby
2008-06-09 15:30:42 UTC
Permalink
Post by David Bertrand
MSVC7 libraries compiled with -Zc:wchar_t switch (Treat wchar_t as
Built-in Type) are incompatible with the ones compiled without. This
basically changes the compiler interpretation of wchar_t from unsigned
short to a native wchar_t. Everything go fine until you link to
unicode functions. Since it's a global compile setting, your
application cannot mix and match libraries compiled with different
setting : it will give you link errors.
Boost v1.35 library uses the -Zc:wchar_t switch, and OmniOrb do not use it.
Since MSVC8 activates the -Zc:wchar_t switch by default, I feel it
confirms Boost is right. For testing purposes, I added the switch to current
release.
It's a perfectly reasonable thing to do. However, I can't do it for the
main release in omniORB 4.1.x, since it will break binary compatibility
between versions.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...