[ome-devel] Building OmeroCpp
josh.moore at gmx.de
josh.moore at gmx.de
Tue Sep 30 07:50:26 BST 2008
James Perry writes:
> Hi Josh,
>
> > If you've followed what's on both:
> >
> > https://trac.openmicroscopy.org.uk/omero/wiki/BlitzBuild
> > https://trac.openmicroscopy.org.uk/omero/wiki/OmeroContributing
> >
> > then you can get started via the top level ant build:
> >
> > cd OMERO_HOME
> > ant build-cpp
>
> Many thanks. I got the C++ libraries to build successfully.
Whew. Good to hear.
> I'm now trying to compile the simple example from the OmeroCpp page on
> TRAC but running into a problem. I had to comment out the
> "omero.closeOnDestroy();" line as the compiler complained about it,
A typo. I've updated the page, but the essential change is that
closeOnDestroy() should be called on the proxy returned from
createSession:
omero::api::ServiceFactoryPrx sf = omero.createSession();
sf->closeOnDestroy();
> and reverse the order of the common and client libraries in the
> makefile to get rid of hundreds of linker errors due to client
> depending on lots of things from common.
Hmmm...that's an interesting one. I've never had an issue with that,
nor could I reproduce it just now. You may have already sent it, but
would you mind telling us your OS info again along with your version
of make and your compiler.
> I'm still getting one linker
> error:
>
> g++ -o omerotest omerotest.o -L/home/digs/trunk/dist/lib
> -L/home/digs/Ice/lib -lIce -lIceUtil -lGlacier2 -lOMERO_client
> -lOMERO_common -lstdc++
> /home/digs/trunk/dist/lib/libOMERO_client.a(ObjectFactoryRegistrar.o):
> In function `omero::ObjectFactory::create(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> >
> const&)':ObjectFactoryRegistrar.cpp:(.text+0xd16f): undefined
> reference to `omero::model::CommentAnnotationI::CommentAnnotationI()'
> collect2: ld returned 1 exit status
> make: *** [omerotest] Error 1
>
> Any ideas what might be causing it?
Yes. Unfortunately, I do. The autoconf configuration requires all new
code-generated objects to be added (redundantly). CommentAnnotation
wasn't. The simplest fix for you to finish testing is to add
CommentAnnotation.cpp and CommentAnnotationI.cpp to your build:
$ cp ../../components/tools/OmeroCpp/src/slice_generated/omero/model/CommentAnnotation.cpp .
$ cp ../../components/tools/OmeroCpp/target/temp/omero/model/CommentAnnotationI.cpp .
and change:
yourcode.o: yourcode.cpp --> %.o: %.cpp
yourcode: yourcode.o ---> yourcode: yourcode.o CommentAnnotation.o CommentAnnotationI.o
Sorry about that. I'll remove the currently unused CommentAnnotation
for a later release.
> Thanks,
> James
Best wishes,
~Josh.
More information about the ome-devel
mailing list