[omniORB] how to rebuild echo with static omniORB libraries?

Dmitry Mityugov OxDD@digitalme.com
Fri, 25 May 2001 15:26:22 +0400


Sai-Lai Lo wrote:
> Dimitry,
>
> I assume you have created a platform .mk file similar to x86_nt_4.0.mk. In
> that
> case you are using the settings in win32.mk.

In fact I created not only a platform .mk file similar to x86_nt_4.0 but
also a file based on win32.mk, win32_cw6.mk.

> If you look into win32.mk, edit the lines that set the library names as
> follows:
>
> ----
> lib_depend := $(patsubst %,$(LibPattern),omniORB)
> omniORB_lib_depend := $(GENERATE_LIB_DEPEND)
>
> lib_depend := $(patsubst %,$(LibPattern),omniDynamic)
> omniDynamic_lib_depend := $(GENERATE_LIB_DEPEND)
>
> OMNIORB_LIB = $(patsubst %,$(LibPattern),omniORB) \
> $(patsubst %,$(LibPattern),omniDynamic) \
> $(OMNITHREAD_LIB) wsock32.lib advapi32.lib
> OMNIORB_LIB_NODYN = $(patsubst %,$(LibPattern),omniORB) \
>             $(msvc_work_around_stub) \
> $(OMNITHREAD_LIB) wsock32.lib advapi32.lib
...

Or more exactly as

lib_depend := $(patsubst %,$(LibPattern),omniORB$(OMNIORB_MAJOR_VERSION))
omniORB_lib_depend := $(GENERATE_LIB_DEPEND)

lib_depend := $(patsubst
%,$(LibPattern),omniDynamic$(OMNIORB_MAJOR_VERSION))
omniDynamic_lib_depend := $(GENERATE_LIB_DEPEND)
...
OMNIORB_LIB = $(patsubst %,$(LibPattern),omniORB$(OMNIORB_MAJOR_VERSION)) \
 $(patsubst %,$(LibPattern),omniDynamic$(OMNIORB_MAJOR_VERSION)) \
 $(OMNITHREAD_LIB) -lwsock32.lib -ladvapi32.lib
OMNIORB_LIB_NODYN = $(patsubst
%,$(LibPattern),omniORB$(OMNIORB_MAJOR_VERSION)) \
 $(msvc_work_around_stub) \
 $(OMNITHREAD_LIB) wsock32.lib advapi32.lib
...

Thank you, that helped a lot.

It seems however that this is not the only required modification. When
applied to win32.mk, Visual C++ complains:

+
../../../bin/x86_win32/linkwrapper -gnuwin32 -out:eg3_tieimpl.exe -libpath:.
./../../lib/x86_win32 eg3_tieimpl.o ../../..
/stub/echoSK.o omniORB3.lib
msvcstub.lib -NODEFAULTLIB:libcmt.lib -NODEFAULTLIB:libcmtd.lib
omnithread.lib wsock32.lib adv
api32.lib
link -out:eg3_tieimpl.exe -libpath:..\..\..\lib\x86_win32 eg3_tieimpl.o
..\..\..\stub\echoSK.o omniORB3.lib msvcstub.lib -
NODEFAULTLIB:libcmt.lib -NODEFAULTLIB:libcmtd.lib omnithread.lib wsock32.lib
advapi32.lib
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

LINK : warning LNK4049: locally defined symbol ""public: __thiscall
omni_thread::init_t::init_t(void)" (??0init_t@omni_thread@@QAE@XZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: static char const *
const  omni::empty_string" (?empty_string@omni@@2QBDB)" imported
LINK : warning LNK4049: locally defined symbol ""public: static unsigned
long const  CORBA::Object::_PR_magic" (?_PR_magic@Object@CORBA@@2KB)"
imported
LINK : warning LNK4049: locally defined symbol ""char const * const
omniORB_3_0" (?omniORB_3_0@@3PBDB)" imported
LINK : warning LNK4049: locally defined symbol ""public: void __thiscall
omni_mutex::unlock(void)" (?unlock@omni_mutex@@QAEXXZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: void __thiscall
omni_mutex::lock(void)" (?lock@omni_mutex@@QAEXXZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: static char const *
const  CORBA::Object::_PD_repoId" (?_PD_repoId@Object@CORBA@@2PBDB)"
imported
LINK : warning LNK4049: locally defined symbol ""int  omniORB::traceLevel"
(?traceLevel@omniORB@@3HA)" imported

for every target in the echo folder and builds the executables. This is a
minor problem for Visual C++, but CodeWarrior 6.1 displays similar error
messages and builds nothing. What should be changed in addition to win32.mk
to fix this problem for Visual C++?

Thank you in advance.

Dmitry