[omniORB] Linking problems in MSVC++ 5.0

Dee Jay Randall randal@cs.uregina.ca
Fri, 6 Nov 1998 10:53:18 -0600 (CST)


  With Dominic's comments, I got my libc* problem solved. He was
right on.

  Would you recommend I compile multithreaded with static omni libs?
I think I will need to do that anyway, in case we want to run the
executable elsewhere, it would simplify installation requirements.

  omni uses <string.h>, so I need to use the 'old' versions. Does this
mean I won't be able to use the STL stuff? That would be bad, since
the whole application that I'm trying to corba-ize is built on stuff
in the STL. The link errors do not seem to be related to stl stuff.

  My first three errors are now:
> 
> Linking...
> server.obj : error LNK2001: unresolved external symbol "public: static void __cdecl CORBA::string_free(char *)" (?string_free@CORBA@@SAXPAD@Z)
> dmvi.obj : error LNK2001: unresolved external symbol "public: static void __cdecl CORBA::string_free(char *)" (?string_free@CORBA@@SAXPAD@Z)
> dmvi.obj : error LNK2001: unresolved external symbol "void __cdecl _CORBA_null_string_ptr(unsigned char)" (?_CORBA_null_string_ptr@@YAXE@Z)
> 

  grepping the runtime debug omni libraries for the functions
gives me this:
> C:\omniORB_2.6.1\lib\x86_win32>find "string_free" *rtd.lib
> ---------- OMNILC22_RTD.LIB
> ---------- OMNIORB260_RTD.LIB
> ?string_free@CORBA@@YAXPAD@Z
> __imp_?string_free@CORBA@@YAXPAD@Z
> ?string_free@CORBA@@YAXPAD@Z
> __imp_?string_free@CORBA@@YAXPAD@Z
> ?string_free@CORBA@@YAXPAD@Z
> __imp_?string_free@CORBA@@YAXPAD@Z
> ---------- OMNITHREAD2_RTD.LIB
> C:\omniORB_2.6.1\lib\x86_win32>find "null_string_ptr" *rtd.lib
> ---------- OMNILC22_RTD.LIB
> ---------- OMNIORB260_RTD.LIB
> ?_CORBA_null_string_ptr@@YAX_N@Z
> __imp_?_CORBA_null_string_ptr@@YAX_N@Z
> ?_CORBA_null_string_ptr@@YAX_N@Z
> __imp_?_CORBA_null_string_ptr@@YAX_N@Z
> _??_CORBA_null_string_ptr@@YAX_N@Z
> __imp_?_CORBA_null_string_ptr@@YAX_N@Z
> ---------- OMNITHREAD2_RTD.LIB
> C:\omniORB_2.6.1\lib\x86_win32>
>

  So the functions are in there, but their symbols are not
matched... ie: for string_free (omnilib) the mangled symbol is
this "?string_free@CORBA@@YAXPAD@Z", but VC is looking for
"?string_free@CORBA@@SAXPAD@Z". Likewise with CORBA_null_string_ptr.
What on earth does this mean? And how do I fix it...

  Dee Jay

On Fri, 6 Nov 1998, James Riden wrote:
>
> Unfortunately it's not quite as easy as this - you need to read the help
> page somewhere about which of the various libraries libc, libcmt, msvcrt
> you need.
> 
> /ML on the compile line means use libc, single threaded version
> /MT                               libcmt, multithreaded version
>  etc.
> 
> It's there somewhere, although it's hard to decipher. We had endless
> trouble trying to compile a multithreaded executable linked with the
> omni dlls. (Don't be tempted to use the single threaded version even
> if it works - it falls over on multiprocessor platforms.)
> 
>   James
> 
> PS: omni uses <string.h> at some point, so you need to use the 'old'
> versions of the libraries as opposed to the newer ones (ie the ones
> with all the nice standard library functionality). You'll know what
> I mean if you find the correct help page.
> 
> >
> >  I have even exported a makefile and can see the appropriate
> >libraries and library path in the variables in the include file.
> >
> >  Does anyone have any idea why this won't work for me? (Hmmm. Does
> >anyone know what the first "libcmt" error is about, I don't understand
> >that one?)
> >
>