Archived

This forum has been archived. Please start a new discussion on GitHub.

problem to compile my Ice program

I created the dataStreamTransfer.ice file.

I created a freeze map IntDatatextMap with the following command:
> slice2freeze --dict IntDatatextMap,int,dataStreamTransfer::datatext IntDatatextMap \
> dataStreamTransfer.ice

I wrote the dataStreamTransferIS.h file.

And I worte the dataStreamTransferIS.cpp file.
Finally I linked with:
>c++ -I. -I/usr/include -c streamServer.cpp dataStreamTransfer.cpp dataStreamTransferIS.cpp IntDatatextMap.cpp

And there were not errors.

Then I compiled with:
c++ -o dataStreamServer streamServer.o dataStreamTransfer.o dataStreamTransferIS.o IntDatatextMap.o -L/usr/lib -lIce -lIceGrid -lFreeze


Why there is an undefined reference to FileStoreI::_mapString ?
How I can solve it?

Comments

  • dwayne
    dwayne St. John's, Newfoundland
    You problem is just a C++ problem and has nothing to do with Ice. You are declaring the data members of the FileStoreI class (_mapString, etc) as static in your dataStreamTransferIS.h but not defining them anywhere. In dataStreamTransferIS.cpp you should have:
    string FileStoreI::_dbName;
    Ice::CommunicatorPtr FileStoreI::_communicator;
    etc
    
  • it seems to work now

    Thank you very much for your help.
    I could compile and run my program.