Results 1 to 2 of 2

Thread: cannot allocate an object

  1. #1
    peter is offline Registered User
    Name: Peter Jaxy
    Organization: Reihnisch Westfälisch technische Hochschule
    Project: Integrative Production Technologie
    Join Date
    Jan 2009
    Posts
    30

    cannot allocate an object

    I get the following error messages:
    streamServer.cpp: In member function ‘virtual int dataStreamServer::run(int, char**)’:
    streamServer.cpp:23: error: cannot allocate an object of abstract type ‘FileStoreI’
    ./dataStreamTransferIS.h:8: note: because the following virtual functions are pure within ‘FileStoreI’:
    ./dataStreamTransfer.h:510: note: virtual void dataStreamTransfer::FileStore::getDataString(const std::string&, std::string&, const Ice::Current&)
    dataStreamTransferIS.cpp: In member function ‘virtual void FileStoreI::getDataString(const std::string&, const std::string&, const Ice::Current&)’:
    dataStreamTransferIS.cpp:108: error: passing ‘const std::string’ as ‘this’ argument of ‘std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>:perator=(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ discards qualifiers
    dataStreamTransferIS.cpp:119: error: passing ‘const std::string’ as ‘this’ argument of ‘std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>:perator=(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ discards qualifiers
    dataStreamTransferIS.cpp:130: error: passing ‘const std::string’ as ‘this’ argument of ‘std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>:perator=(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ discards qualifiers
    dataStreamTransferIS.cpp:141: error: passing ‘const std::string’ as ‘this’ argument of ‘std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>:perator=(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ discards qualifiers

    I only changed, that my "getDataString" - method has an out Parameter in the interface Definition.
    Why???
    Attached Files Attached Files

  2. #2
    dwayne's Avatar
    dwayne is offline ZeroC Staff
    Name: Dwayne Boone
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Jan 2005
    Location
    St. John's, Newfoundland
    Posts
    397
    Your implementation of getDataString() is using "const" with the second parameter. This does not match the generated definition, which does not have a const second parameter since it is an out parameter and needs to be modified by the getDataString() implementation.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Cannot allocate memory
    By xavierk in forum Help Center
    Replies: 6
    Last Post: 09-07-2010, 04:16 AM
  2. Find object in object adapter by its proxy
    By dnnbg in forum Help Center
    Replies: 2
    Last Post: 02-25-2009, 04:09 AM
  3. Allocate/Release in session?
    By bwvb in forum Help Center
    Replies: 2
    Last Post: 07-03-2007, 05:31 PM
  4. Replies: 2
    Last Post: 06-23-2007, 07:19 AM
  5. Object Factories and object initialisation
    By Nis Baggesen in forum Help Center
    Replies: 1
    Last Post: 09-30-2004, 07:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •