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

Nick Perry nperry at stanford.edu
Wed Sep 9 15:34:52 BST 2009


I used the example (yourcode.cpp, Makefile) found on
http://trac.openmicroscopy.org.uk/omero/wiki/OmeroCpp and got it to compile
correctly.

However, now I'm trying a different cpp file that I got from
http://trac.openmicroscopy.org.uk/omero/wiki/OmeroClients?onlycpp

On my desktop, I have api_test.cpp and Makefile. Also on the desktop is the
omero folder I got from SVN with the libraries. When I type make api_test, I
get the following error (this is only the first few lines):

> 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
In file included from
/Users/nperry/Desktop/omero/dist/include/omero/client.h:12,
                 from api_test.cpp:9:
/Users/nperry/Desktop/omero/dist/include/omero/API.h:16:30: error:
Ice/LocalObjectF.h: No such file or directory
/Users/nperry/Desktop/omero/dist/include/omero/API.h:17:24: error:
Ice/ProxyF.h: No such file or directory
/Users/nperry/Desktop/omero/dist/include/omero/API.h:18:25: error:
Ice/ObjectF.h: No such file or directory
/Users/nperry/Desktop/omero/dist/include/omero/API.h:19:27: error:
Ice/Exception.h: No such file or directory
/Users/nperry/Desktop/omero/dist/include/omero/API.h:20:29: error:
Ice/LocalObject.h: No such file or directory
/Users/nperry/Desktop/omero/dist/include/omero/API.h:21:23: error:
Ice/Proxy.h: No such file or directory
/Users/nperry/Desktop/omero/dist/include/omero/API.h:22:24: error:
Ice/Object.h: No such file or directory

*Here is my Makefile:*
#

#
MAKEFILE:

#

# Where the OMERO distribution was
installed
OMERO_DIST?=/Users/nperry/Desktop/omero/dist

# Where the Ice lib/ and include/ directories are to be
found
ICE_HOME?=/Library/Ice-3.3.1

INCLUDES=-I$(OMERO_DIST)/include -I$(ICE_HOME)/include

LIBS=-L$(OMERO_DIST)/lib -L$(ICE_HOME)/lib -L$(ICE_HOME)/lib64 \
     -lIce -lIceUtil -lGlacier2 -lomero_client -lstdc++

LIBPATH=$(DYLD_LIBRARY_PATH):$(ICE_HOME)/lib:$(ICE_HOME)/lib64:$(OMERO_DIST)/lib

.PHONY: clean run

api_test.o: api_test.cpp
        $(CXX) $(CXXFLAGS) -c -o $@ $< $(INCLUDES)

api_test: api_test.o
        $(CXX) -o $@ $^ $(LIBS)

run:  api_test

*And here is the cpp file (literally, this is copied directly from the site
above):
*#include <iostream>
#include <omero/client.h>
#include <omero/RTypesI.h>
#include <omero/sys/ParametersI.h>

using namespace omero::rtypes;
int main(int argc, char* argv[]) {
    omero::client client("localhost");
    omero::api::ServiceFactoryPrx sf = client.createSession("nick",
"omero");
    omero::api::IQueryPrx q = sf->getQueryService();
    std::string query_string = "select i from Image i where i.id = :id and
name like :namedParameter";
    omero::sys::ParametersIPtr p = new omero::sys::ParametersI();
    p->add("id", rlong(1L));
    p->add("namedParameter", rstring("cell%mit%"));
    omero::api::IObjectList results = q->findAllByQuery(query_string, p);
    client.closeSession();
    return 0;
}
*
*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?

Thanks
Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20090909/ddda6a69/attachment.htm 


More information about the ome-devel mailing list