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

Bernhard Holländer bernhard.voigt at gmail.com
Thu Sep 10 15:38:21 BST 2009


Hi Josh and Nick,

maybe I'm missing something but omero::cast does not return anything,
though I would expect to segfault the TreeList example....

this is from https://trac.openmicroscopy.org.uk/omero/browser/trunk/components/tools/OmeroCpp/src/omero/templates.h

template<class T> std::vector<T> cast(omero::api::IObjectList& v) {
        std::vector<T> rv;
        omero::api::IObjectList::iterator beg = v.begin();
        while (beg != v.end()) {
            rv.push_back(T::dynamicCast(*beg));
            beg++;
        }
        // this is missing!!!
        return rv;
}

Nick, a good place to look for examples are the OmeroCpp tests:

http://trac.openmicroscopy.org.uk/omero/browser/trunk/components/tools/OmeroCpp/test

Cheers! Bernhard

On Thu, Sep 10, 2009 at 2:52 PM, Nick Perry<nperry at stanford.edu> wrote:
> Thanks Josh that was helpful.
>
> Aside from getting used to C++ again, I'm making some progress. I started
> playing around with one of the other examples (TreeList), but I think I'm
> having another issue. If my understanding is correct, TreeList should print
> out the name of all the projects for a given username (or something close to
> that).
>
> I currently have 1 project in my local OMERO server. There is one dataset
> containing one image in this project. However, when I run TreeList, nothing
> prints. Also, it thinks the vector resulting from
>
> std::vector<omero::model::ProjectPtr> projects =
> AllProjects::getProjects(factory->getQueryService(), "nick");
>
> has size 0. I would think with one project for the username I'm giving it
> ("nick") that the vector of pointers should have size 1... Makes me think
> that something is wrong in AllProjects.h, but nothing is popping out at me
> as wrong.
>
> Do you have any idea what might be going on?
>
> Also, are there are more examples for C++ or is the best way for me to
> figure out  how to write clients by going through docs/slice definitions one
> by one to find the methods I need...?


More information about the ome-devel mailing list