<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Arial">Hi,<br>
<br>
I've been in the process of upgrading our development environment from
VC6 (Visual Studio 6) to VC7.1 (Visual Studio .NET 2003) and ran across
some problems. This was caused by a combination of several ways we use
omniORB and I'm not sure if anyone else has run into this. Here's the
setup:<br>
<br>
- We have implemented Cos Notification services and use the
flattened-tie classes generated by the idl compiler (omniidl -bcxx
-Wba,tf etc.). The idl compiler generates template definitions for
these such as the following (pertinent part only, from the header file
for CosNotifyCom.idl):<br>
<br>
<snip><br>
<br>
template <class _dyn_attr _omniT><br>
class _dyn_attr POA_CosNotifyComm_StructuredPushSupplier_tie : public
virtual POA_CosNotifyComm::StructuredPushSupplier<br>
{<br>
<br>
<snip><br>
<br>
- We link all our stubs into one dll, thus use the USE_stub_in_nt_dll
define for all programs. The stubs for CosNotification, CosNotifyComm,
CosNotifyChannelAdmin, etc., are all included in this stub dll.<br>
<br>
What happens when we compile an application that makes use of one of
these templates, and the fact that we're defining USE_stub_in_nt_dll,
the method signature results in something like:<br>
<br>
</font></font>__declspec(dllimport) public: __thiscall
POA_CosNotifyComm_StructuredPushSupplier_tie<class service_i="">::POA_CosNotifyComm_StructuredPushSupplier_tie<class
service_i="">(class Service_i *,bool)</class></class><br>
<font size="-1"><font face="Arial"><br>
This compiles fine, but throws a LNK2019: unresolved external symbol
during the link, due to the "__declspec(dllimport)" I believe, since
the template expansion is not part of the stubs dll, but expanded
locally in the object file generated by the compiler, and the storage
class attribute is dllimport.<br>
<br>
The fix was to hack the header file and remove the _dyn_attr from the
template definitions. This changed the storage class attributes on the
generated templates so they could be linked from the local object
file. We didn't have this problem with VC6 - is this due to changes
(enhancements?) in the linker?<br>
<br>
I'm wondering if the modifier "_dyn_attr" should be removed from
template definitions generated by the idl compiler?<br>
<br>
I'm also trying to fix a problem with duplicate definitions:<br>
<br>
</font></font>cos.lib(any.obj) : error LNK2005: "public: __thiscall
_CORBA_Unbounded_Sequence<class corba::any="">::~_CORBA_Unbounded_Sequence<class
corba::any="">(void)"
(??1?$_CORBA_Unbounded_Sequence@VAny@CORBA@@@@QAE@XZ) already defined
in omniDynamic406_rtd.lib(omniDynamic406_rtd.dll)</class></class><br>
<font size="-1"><font face="Arial"><br>
We have some utilities that work on CORBA::Any types and it seems the
template for _CORBA_Unbounded_Sequence< CORBA::Any> was generated
in our code as well as in omniDynamic (???).<br>
<br>
Any suggestions or comments appreciated!<br>
<br>
Mark<br>
<br>
</font></font>
<div class="moz-signature">-- <br>
<span style="font-size: 10pt; color: black; font-family: Verdana;">Mark
A. Johnson</span><br>
<span
style="font-size: 10pt; color: rgb(255, 0, 0); font-family: Verdana;">
NetQoS, Inc.</span><br>
<span style="font-size: 7.5pt; color: gray; font-family: Verdana;">
60 E. Marie Ave<br>
Suite 204<br>
West St. Paul, MN 55118<br>
Office: (01) 651.552.2111<br>
<u><br>
<i><a href="mailto:mark@redpt.com">mark@redpt.com</a><br>
<a href="http://www.redpt.com/" target="3D_blank">http://www.redpt.com</a></i></u></span>
<p><br>
</p>
</div>
</body>
</html>