[ome-devel] Having trouble compiling cpp file with Makefile

josh.moore at gmx.de josh.moore at gmx.de
Wed Sep 9 16:58:18 BST 2009


Nick Perry writes:
 > Hey Josh,

Hey Nick,

 > Sorry to bug you with something so specific, 

No worries. The C++ documentation is definitely lacking, but as more
of you want to use it, we'll do everything we can to make it
easier. So please ask away.

 > but if I'm trying to find out what methods / documentation are
 > available for IObjectList in the line
 > 
 >      omero::api::IObjectList results =
 >      q->findAllByQuery(query_string, p);
 >
 > on http://hudson.openmicroscopy.org.uk/job/OMERO/javadoc/, how
 > would i go about doing it? Probably just my inexperience with
 > C++/C, but I would go to the top left frame, click on api, then
 > look for IObjectList, since I imagine 'results' is an object of
 > type IObjectList, and look for methods there. But I can't find it
 > on that list. How do I actually look up IObjectList?

When you run up against something in the source code which you don't
know how to handle, the first thing to do is to find it in the slice
definition files. omero::api::IObjectList can be found here:

  https://trac.openmicroscopy.org.uk/omero/browser/trunk/components/blitz/resources/omero/Collections.ice#L102

As you can see there's an annotation for mapping the list to a
List<IObject> in Java, rather than IObject[]. This means that it won't
show up in the Java docs since it's not a special type. You can read
more about that in the Ice manual:

  http://zeroc.com/doc/Ice-3.3.1/manual/Java.11.16.html#95298

In C++, something similar happens. See:

  http://zeroc.com/doc/Ice-3.3.1/manual/Cpp.7.7.html

"sequence<omero::model::IObject>" becomes:

  typedef std::vector<omero::model::IObject> IObjectList

so, though there is a typedef in C++ unlike in Java, it's also not
really a new type, but just a vector, therefore all the standard STL
methods, rules, and documentation apply.

Hope that helps,
~Josh.

 > On Wed, Sep 9, 2009 at 5:08 PM, Nick Perry <nperry at stanford.edu> wrote:
 > 
 > > it's in the README for Ice. I've attached my copy (Version 3.3.1)
 > >
 > >
 > > On Wed, Sep 9, 2009 at 5:00 PM, <josh.moore at gmx.de> wrote:
 > >
 > >>
 > >> Nick,
 > >>
 > >> good to know. Do you remember where you saw that definition of
 > >> ICE_HOME? I've seen others with similar issues, and would like to put
 > >> a warning up.
 > >>
 > >> Cheers,
 > >> ~Josh.
 > >>
 > >> Nick Perry writes:
 > >>  > you're right; I just figured that out too as i got this email.
 > >>  >
 > >>  > annoyingly, this is how i was told (wherever I read it, anyway) how to
 > >> make
 > >>  > my .bash_profile and environmental variables:
 > >>  >
 > >>  > export CLICOLOR=1
 > >>  > export LSCOLORS=ExFxCxDxBxegedabagacad
 > >>  > export PS1="\n\[\e[1;40;32m\]\u@\h:\w> \[\e[0m\]"
 > >>  > export PATH=/Library/Ice-3.3.1/bin:$PATH
 > >>  > export DYLD_LIBRARY_PATH=/Library/Ice-3.3.1/lib:$DYLD_LIBRARY_PATH
 > >>  > export PYTHONPATH=/Library/Ice-3.3.1/python:$PYTHONPATH
 > >>  > export ICE_HOME=/Library/Ice-3.3.1:$ICE_HOME
 > >>  >
 > >>  > however, that makes colons after the first part. Most of this was
 > >>  > from the ICE installation. So I monkey-saw-monkey-did and made
 > >>  > ICE_HOME with a semi-colon too...
 > >>  >
 > >>  > /fail
 > >>  >
 > >>  > Thanks
 > >>  > Nick
 > >>  >
 > >>  > On Wed, Sep 9, 2009 at 4:42 PM, <josh.moore at gmx.de> wrote:
 > >>  >
 > >>  > >
 > >>  > > Hi Nick,
 > >>  > >
 > >>  > > Nick Perry writes:
 > >>  > > ...snip...
 > >>  > >  > > make api_test
 > >>  > >  > g++  -c -o api_test.o api_test.cpp
 > >>  > >  > -I/Users/nperry/Desktop/omero/dist/include
 > >> -I/Library/Ice-3.3.1:/include
 > >>  > >
 > >>  > > I don't think there's supposed to be a colon in:
 > >>  > >
 > >>  > >  -I/Library/Ice-3.3.1:/include
 > >>  > >
 > >>  > > With it, g++ can't find all of the Ice header files. Is it possible
 > >>  > > you have ICE_HOME set in your environment with a colon on the end?
 > >>  > >
 > >>  > >  > *Should this all be working? I'm not asking that you figure out if
 > >>  > >  > I have directory issues or path name errors, but if you look at
 > >> the
 > >>  > >  > CPP code above (again, provided here:
 > >>  > >  > http://trac.openmicroscopy.org.uk/omero/wiki/OmeroClients?onlycpp
 > >> )
 > >>  > >  > and that makefile, should everything be working?
 > >>  > >
 > >>  > > Otherwise, at a quick glance, everything should be working. But if
 > >> you
 > >>  > > have issues, feel free to send them in.
 > >>  > >
 > >>  > > Cheers,
 > >>  > > ~josh
 > >>  > >
 > >>
 > >
 > >


More information about the ome-devel mailing list