company logo

.Net installation

In order to install the ODABA .Net interface, ODABA-net plug-in has to be installed (????). The plug-in includes the dot net-connector, which is a generic solution for creating .Net interfaces from C++ applications.

Building .Net libraries is not part of the default installation. When one has compiled the Windows version, for using the .Net interface it is necessary to build the .Net libraries. The example below shows a procedure, which just has to be adapted to the current environment.

@setlocal

@if "%VS_ENVIRONMENT%" == "defined" @goto Start

@call "%VS100COMNTOOLS%vsvars32.bat"

@set S10_ENVIRONMENT=defined

@set ODABAROOT=...                 --> set the current odaba source root folder from the installation

@set ODABA_DIR=...odaba            --> Replace with the odaba binary directory

rem  the dotnet-connector installation is required (https://github.com/git-e/dotnet-connector)

@set DNCROOT=...dotnet-connector   --> Replace with dotnet-connector installation directory

@set ROOT=%ODABAROOT%\opa\opi\odaba

rem Compile native part

:native

@if not exist %ROOT%\lib\dnc @mkdir %ROOT%\lib\dnc

@pushd %ROOT%\lib\dnc

del /F /Q *.obj

cl /Zi /RTCscu /GR /I%DNCROOT\include% /I"%ODABA_DIR%\include" /Il:\opa /c /EHsc %ROOT%\qlib\*.dnc.cpp

@popd                %DNCROOT\include%

rem 3. Compile managend part

:managed

@if not exist %ROOT%\lib\dnc-cli @mkdir %ROOT%\lib\dnc-cli

@pushd %ROOT%\lib\dnc-cli

del /F /Q *.obj

cl /Zi /GR /AI %DNCROOT%\build /I%DNCROOT%\include /I"%ODABA_DIR%\include" /I%ODABAROOT%\opa /c /clr /wd4355 /wd4490 %ROOT%\qlib\*.dnc.cpp

@popd

rem 4. Link the whole thing

:link

@if not exist %ROOT%\exe @mkdir %ROOT%\exe

@pushd %ROOT%\exe

rem : build .res

l:\odet\IncreaseID.exe %ROOT%\tpl\odaba-net_version.h %ROOT%\rc\odaba-net.h build

copy %ROOT%\rc\odaba-net.h           %ROOT%\temp\version.h

copy l:\bat\version\win32_version.rc %ROOT%\temp\odaba-net.rc

rc %ROOT%\temp\odaba-net.rc

rem : link with signing

::link /KEYFILE:l:\bat\run-dll.key %ROOT%\lib\dnc\*.obj %ROOT%\lib\dnc-cli\*.obj %ROOT%\temp\odaba-net.res %ODABA_DIR%\lib\opa.lib %DNCROOT%\build\dotnet-connector.lib /OUT:odaba-net.dll /NODEFAULTLIB:LIBCMT /DEBUG /DLL

rem : link without signing

link %ROOT%\lib\dnc\*.obj %ROOT%\lib\dnc-cli\*.obj %ROOT%\temp\odaba-net.res %ODABA_DIR%\lib\opa.lib %DNCROOT%\build\dotnet-connector.lib /OUT:odaba-net.dll /NODEFAULTLIB:LIBCMT /DEBUG /DLL

copy odaba-net.dll %ODABA_DIR%\.

regasm %ODABA_DIR%\odaba-net.dll /tlb:odaba-net.tlb

@popd