Home Help Center

problem to compile my Ice program

peterpeter Member Peter JaxyOrganization: Reihnisch Westfälisch technische HochschuleProject: Integrative Production Technologie ✭✭
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

  • dwaynedwayne St. John's, NewfoundlandMember Dwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications Engine
    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
    
  • peterpeter Member Peter JaxyOrganization: Reihnisch Westfälisch technische HochschuleProject: Integrative Production Technologie ✭✭
    it seems to work now

    Thank you very much for your help.
    I could compile and run my program.
Sign In or Register to comment.