[omniORB] omniORB4.0.2 Problems - reading Windows registry & link error, linking DLL

K.D.Welast at t-online.de K.D.Welast at t-online.de
Mon Sep 15 15:07:01 BST 2003


Hello,
I try porting a client application ( DLL for Win32 Clients) from
omniORB4.0.1 to omniOrb4.0.2 using VC++ 6 and find some problems .

1. ORB Configuration
The ORB_init() function no longer read the configuration data from the
Windows registry. 
It looks like a bug in \..\orbcore\corbaorb.cc. 
The "else-block" will never execute because the config_fname variable
is always set.

    const char* config_fname = CONFIG_DEFAULT_LOCATION;
    {
      const char* f = getenv(CONFIG_ENV);
      if (f) config_fname = f;
    }
    if (config_fname) {
      orbOptions::singleton().importFromFile(config_fname);
    }
#if defined(NTArchitecture) && !defined(__ETS_KERNEL__)
    else {
      // Parse configuration from registry on NT if no configuration
      // file is specified.
      orbOptions::singleton().importFromRegistry();
    }
#endif
		
	Using the standard configuration file C:\OMNIORB.CFG define with
CONFIG_DEFAULT_LOCATION in \..\orbcore\dir.mk not works under Windows
9x.
Windows 9x doesn't except the double backslash see below.

ifdef OMNIORB_CONFIG_DEFAULT_LOCATION
  CONFIG_DEFAULT_LOCATION = $(OMNIORB_CONFIG_DEFAULT_LOCATION)
else
  ifdef UnixPlatform
    CONFIG_DEFAULT_LOCATION = /project/omni/var/omniORB_NEW.cfg
  endif
  ifdef Win32Platform
    CONFIG_DEFAULT_LOCATION = C:\\OMNIORB.CFG
  endif
  ifdef vxWorksPlatform
    CONFIG_DEFAULT_LOCATION = /a2/tmp/omniORB.cfg
  endif
endif

2. Building the application
The linker reports the following error 

mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain at 12 bereits in
MSVCRTD.lib(dllmain.obj) definiert
mfcs42d.lib(dllmodul.obj) : warning LNK4006: _DllMain at 12 bereits in
MSVCRTD.lib(dllmain.obj) definiert; zweite Definition wird ignoriert

	(Of course, he link switch /FORCE:MULTIPLE create two warnings instead
the error and built the DLL file but ...)
 
Using the SK (*.cc and *.hh) files generated with omniORB4.0.1 the
linker reports no errors
 
Best regards

Kl. D. Welast



More information about the omniORB-list mailing list