[omniORB] application attempted to invoke an operation on a nil reference

Wittstruck, Nicholas Nicholas.Wittstruck at student.hpi.uni-potsdam.de
Thu Jul 1 22:12:49 BST 2010


I'm using the dir.mak from the echo example. Do I have to do any further changes? I tried to set up Visual Studio 2008 to run it, but I couldn't even start my application after compiling it. That is why I used the make file from the examples.

My make file looks like this:

----
#
# Usage:
#   nmake /f dir.mak [<build option>]
#
#  <build option>:
#      all       - build all executables
#      clean     - delete all executables and obj files
#      veryclean - clean plus delete all stub files generated by omniidl
#        
#
# Pre-requisite:
#
# Make sure that you have environment variable LIB and INCLUDE setup for
# using Developer studio from the command line. Usually, this is accomplished
# by source the vcvars32.bat file.
#

# Where is the top of this distribution. All executable, library and include
# directories are relative to this variable.
#
TOP = "..\omniORB-4.1.4"


##########################################################################
# Essential flags to use omniORB.
#
DIR_CPPFLAGS   = -I. -I$(TOP)\include
#
# omniDynamic4_rt.lib is the runtime DLL to support the CORBA dynamic
# interfaces, such as Anys, typecodes, DSI and DII. In these examples, the
# runtime library is not required as none of these features are used.
# However, a bug in MSVC++ causes it to generate a bunch of references
# to functions in omniDynamic4_rt.lib when compiling the stubs.
# So now we link the dynamic library as well.
# An alternative is to replace the dynamic library with the much smaller 
# library msvcstub.lib. The smaller library contains nothing but stubs
# for the required functions. This is enough when none of the dynamic
# interfaces are used. We use the small library here. If you prefer
# to link with the dynamic library, swap the comment on the next 2
# lines.
#OMNI_DYNAMIC_LIB = omniDynamic4_rt.lib
OMNI_DYNAMIC_LIB = msvcstub.lib -NODEFAULTLIB:libcmt.lib -NODEFAULTLIB:libcmtd.lib 


CORBA_CPPFLAGS = -D__WIN32__ -D_WIN32_WINNT=0x0400 -D__x86__ -D__NT__ \
                 -D__OSVERSION__=4
CORBA_LIB      = omniORB4_rt.lib omnithread_rt.lib \
                 $(OMNI_DYNAMIC_LIB) \
                 ws2_32.lib mswsock.lib advapi32.lib \
                 -libpath:$(TOP)\lib\x86_win32

CXXFLAGS       = -O2 -MD -GX $(CORBA_CPPFLAGS) $(DIR_CPPFLAGS)
CXXLINKOPTIONS =

.SUFFIXES: .cc
.cc.obj:
  cl /nologo /c $(CXXFLAGS) /Tp$<

########################################################################
# To build debug executables
# Replace the above with the following:
#
#OMNI_DYNAMIC_LIB = omniDynamic4_rtd.lib
#OMNI_DYNAMIC_LIB = msvcstubd.lib -NODEFAULTLIB:libcmt.lib -NODEFAULTLIB:libcmtd.lib 
#CORBA_CPPFLAGS = -D__WIN32__ -D_WIN32_WINNT=0x0400 -D__x86__ -D__NT__ -D__OSVERSION__=4
#CORBA_LIB      = omniORB4_rtd.lib omnithread_rtd.lib \
#                 $(OMNI_DYNAMIC_LIB) \
#                 ws2_32.lib mswsock.lib advapi32.lib -libpath:$(TOP)\lib\x86_win32
#CXXFLAGS       = -MDd -EHsc -Z7 -Od  $(CORBA_CPPFLAGS) $(DIR_CPPFLAGS)
#CXXLINKOPTIONS = -debug -PDB:NONE	

all:: functions.exe 

functions.exe: guiSK.obj functionsSK.obj functions.obj
  link -nologo $(CXXLINKOPTIONS) -out:$@ $** $(CORBA_LIB) 
clean::
  -del *.obj
  -del *.exe


veryclean::
  -del *.obj
  -del echoSK.* echo.hh
  -del *.exe

gui.hh guiSK.cc: gui.idl
	$(TOP)\bin\x86_win32\omniidl -T -bcxx -Wbh=.hh -Wbs=SK.cc -Wbtp gui.idl

functions.hh functionsSK.cc: functions.idl
	$(TOP)\bin\x86_win32\omniidl -T -bcxx -Wbexample -Wbh=.hh -Wbs=SK.cc -Wbtp 
functions.idl





On 01.07.2010, at 18:04, Duncan Grisby wrote:

> On Wed, 2010-06-30 at 22:15 +0200, Wittstruck, Nicholas wrote:
> 
>> Yes, the pi(in string id) method is called. The output gets printed,
>> and code within will be executed. But when the execution finishes the
>> program crashes. I'm not using JacORB, I'm using the Sun Orb.
> 
> No doubt you are using Windows, and you are mixing debug and non-debug
> code. Make sure you match all the debugging settings.
> 
> http://www.omniorb-support.com/omniwiki/FrequentlyAskedQuestions#head-9d43363054ee434faa49ca43c21026f09076aeec
> 
> Duncan.
> 
> -- 
> -- Duncan Grisby         --
>  -- duncan at grisby.org     --
>   -- http://www.grisby.org --
> 
> 




More information about the omniORB-list mailing list