Results 1 to 15 of 15

Thread: Compile gives error C2555

  1. #1
    pokemoen is offline Registered User
    Name: Alex Man
    Organization: None
    Project: SWCCG
    Join Date
    May 2005
    Posts
    22

    Compile gives error C2555

    Hello, I was wondering if someone could help me with this.
    In VC7.1 I compile and get:
    Code:
    e:\Src\swccg\SWCCG\ICE\include\SWCCG.h(481): error C2555: 'SWCCG::Auth::ice_isA': overriding virtual function return type differs and is not covariant from 'Ice::Object::ice_isA'
    e:\Src\swccg\SWCCG\ICE\include\SWCCG.h(481): error C2555: 'SWCCG::Auth::ice_isA': overriding virtual function return type differs and is not covariant from 'Ice::Object::ice_isA'
    e:\Src\swccg\SWCCG\ICE\include\SWCCG.h(541): error C2555: 'SWCCG::Game::ice_isA': overriding virtual function return type differs and is not covariant from 'Ice::Object::ice_isA'
    e:\Src\swccg\SWCCG\ICE\include\SWCCG.h(541): error C2555: 'SWCCG::Game::ice_isA': overriding virtual function return type differs and is not covariant from 'Ice::Object::ice_isA'
    e:\Src\swccg\SWCCG\ICE\include\SWCCG.h(524): error C2555: 'SWCCG::Server::ice_isA': overriding virtual function return type differs and is not covariant from 'Ice::Object::ice_isA'
    e:\Src\swccg\SWCCG\ICE\include\SWCCG.h(524): error C2555: 'SWCCG::Server::ice_isA': overriding virtual function return type differs and is not covariant from 'Ice::Object::ice_isA'
    The code where the first error points to: (slice2cpp generated SWCCG.h)
    Code:
    class Auth : virtual public ::Ice::Object
    {
    public:
    
        virtual bool ice_isA(const ::std::string&, const ::Ice::Current& = ::Ice::Current()) const;
        virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Current& = ::Ice::Current()) const;
        virtual const ::std::string& ice_id(const ::Ice::Current& = ::Ice::Current()) const;
        static const ::std::string& ice_staticId();
    
        virtual ::Ice::Int create(const ::std::string&, const ::std::string&, const ::std::string&, const ::std::string&, const ::Ice::Current& = ::Ice::Current()) = 0;
        ::IceInternal::DispatchStatus ___create(::IceInternal::Incoming&, const ::Ice::Current&);
    
        virtual ::SWCCG::Player login(const ::std::string&, const ::std::string&, const ::Ice::Current& = ::Ice::Current()) = 0;
        ::IceInternal::DispatchStatus ___login(::IceInternal::Incoming&, const ::Ice::Current&);
    
        virtual ::SWCCG::Player get(const ::std::string&, const ::Ice::Current& = ::Ice::Current()) = 0;
        ::IceInternal::DispatchStatus ___get(::IceInternal::Incoming&, const ::Ice::Current&);
    
        virtual ::IceInternal::DispatchStatus __dispatch(::IceInternal::Incoming&, const ::Ice::Current&);
    
        virtual void __write(::IceInternal::BasicStream*) const;
        virtual void __read(::IceInternal::BasicStream*, bool);
        virtual void __write(const ::Ice::OutputStreamPtr&) const;
        virtual void __read(const ::Ice::InputStreamPtr&, bool);
    }; // <--- Error points here!
    I upgraded to 2.1.2 (was on 2.0.0 first..) but that didn't help, so maybe I'm doing something wrong?
    Searching the forum and net didn't help much. Any ideas?

    Thanks in advance,
    Alex
    Last edited by pokemoen; 11-03-2005 at 10:50 AM.
    Alexander
    (School)Project: StarWars Customized Cardgame

  2. #2
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Hi Alex,

    Please see this thread if you want us to help you figure out this problem.

    Thanks,

    Benoit.

  3. #3
    pokemoen is offline Registered User
    Name: Alex Man
    Organization: None
    Project: SWCCG
    Join Date
    May 2005
    Posts
    22
    Okay, voila.
    Alexander
    (School)Project: StarWars Customized Cardgame

  4. #4
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Looks like you're defining 'bool' to something else.
    Do you get any error while compiling the .cpp files generated by slice2cpp?

    Cheers,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  5. #5
    pokemoen is offline Registered User
    Name: Alex Man
    Organization: None
    Project: SWCCG
    Join Date
    May 2005
    Posts
    22
    I did "slice2cpp --impl --ice --output-dir c:\bla c:\bla\SWCCG.ice" and after adding a main() (just cout'ed something), it compiled (and ran) fine.

    I don't have any funcs in my .ice that return booleans, isn't ice_isA a helperclass? (to check what type an object is)

    Thanks.
    Alexander
    (School)Project: StarWars Customized Cardgame

  6. #6
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    What are you compiling that gives you that error? Is it your own code? If so, then find out what is re-defining bool and remove that badness

  7. #7
    pokemoen is offline Registered User
    Name: Alex Man
    Organization: None
    Project: SWCCG
    Join Date
    May 2005
    Posts
    22
    The error occurs in slice generated code (see the second code-frame in the first post, the comment "Error points here" at the bottom). I'm sure it's my own fault, but I can't seem to find the cause..

    Thanks,
    Alex
    Alexander
    (School)Project: StarWars Customized Cardgame

  8. #8
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    The error occurs in a slice-generated header file (SWCCG.h). Which .cpp file that includes this header file is causing the error?

  9. #9
    pokemoen is offline Registered User
    Name: Alex Man
    Organization: None
    Project: SWCCG
    Join Date
    May 2005
    Posts
    22
    It occurs when compiling client.cpp, which includes client.h, which in turn includes SWCCG.h.
    Here's client.h
    Code:
    #ifndef SWCCG_CLIENT_H
    #define SWCCG_CLIENT_H
    
    #include <Ice/Ice.h>
    #include "SWCCG.h"
    
    #include "console.h"
    
    #include <string>
    #include <vector>
    
    #ifndef UINT
    #define UINT
    typedef unsigned int uint;
    #endif
    
    using namespace Ice;
    
    class client : public handler {
    
    protected:
    	int running;
    	console *screen;
    	Ice::CommunicatorPtr ic;
    	
    public:
    	SWCCG::Player player;
    	SWCCG::ServerPrx server;
    
    	inline client() : running(1), server(NULL) {
    		screen = new console(this);
    		player.id = 0;
    		player.credits = 0;
    	}
    	inline client(Ice::CommunicatorPtr _ic) : running(1), ic(_ic), server(NULL) { 
    		screen = new console(this);
    		player.id = 0;
    		player.credits = 0;
    	}
    	inline virtual ~client() {}
    
    	void join(SWCCG::ServerPrx);
    	void setAuth(SWCCG::AuthPrx);
    	void disconnect();
    
    	virtual int run();
    
    	int parse(std::string);
    
    	int help(std::vector<std::string>);
    	int connect(std::vector<std::string>);
    	int create(std::vector<std::string>);
    	int login(std::vector<std::string>);
    	int list(std::vector<std::string>);
    	int quit(std::vector<std::string>);
    	int heartbeat(std::vector<std::string>);
    	int invite(std::vector<std::string>);
    	int whoami(std::vector<std::string>);
    	int listCards(std::vector<std::string>);
    	
    private:
    	typedef struct {
    		std::string name;
    		std::string help;
    	} commands;
    	static commands cmds[];
    };
    
    #endif	// SWCCG_CLIENT_H
    Thanks,
    Alexander
    (School)Project: StarWars Customized Cardgame

  10. #10
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    Can you show us the code of client.cpp, at least the first lines up to the #include statements.

  11. #11
    pokemoen is offline Registered User
    Name: Alex Man
    Organization: None
    Project: SWCCG
    Join Date
    May 2005
    Posts
    22
    Woops
    Code:
    #include <Ice/Ice.h>
    
    //#ifdef _WIN32	
    //	#include <windows.h>
    //	#include <wtypes.h>
    //#endif
    
    #include <string>
    #include <vector>
    #include <iostream>
    #include <iomanip>
    #include <sstream>
    
    #ifdef _WIN32
    #include "my_global.h"
    #endif
    
    #include "mysql.h"
    
    #include "client.h"
    #include "client_help.h"
    
    client::commands client::cmds[] = {
    	{ "connect", HELP_CONNECT },
    	{ "register", HELP_REGISTER },
    	{ "login", HELP_LOGIN },
    	{ "list", HELP_LIST },
    	{ "ping", HELP_PING },
    	{ "invite", HELP_INVITE }, 
    	{ "cards", HELP_CARDS }, 
    	{ "whoami", HELP_WHOAMI },
    	{ "quit", HELP_QUIT_ }
    };
    
    void client::join(SWCCG::ServerPrx server) {
    	this->server = server;
    	std::cout << "Joined server" << std::endl;
    }
    
    void client::disconnect() {
    	if (!this->server) return;
                    
    	try {
    		this->server->disconnect(this->player);
    		std::cout << "Disconnected from server" << std::endl;
    		this->server = NULL;
    	} catch (const Ice::Exception &e) {
            std::cout << "Server not responding." << std::endl;
        }
    }
    
    int client::run() {
    	screen->input();
    
    	return running;
    }
    etc..
    Alexander
    (School)Project: StarWars Customized Cardgame

  12. #12
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    Move client.h up to be the first include file and try again. Most likely some of the include files before client.h redefines "bool".

  13. #13
    pokemoen is offline Registered User
    Name: Alex Man
    Organization: None
    Project: SWCCG
    Join Date
    May 2005
    Posts
    22
    I remembered this post, from when it was just a small ICE sample app we had (never really solved it then..), the GUI and game are now merged and this should become our main development app.

    Probably the same problem, here's a buildlog and the corresponding headers:
    Code:
    e:\Src\swccg\SWCCG\ICE\src\client.cpp(47): warning C4101: 'e' : unreferenced local variable
    client error LNK2001: unresolved external symbol "private: virtual class IceInternal::Handle<class IceDelegateD::Ice::Object> __thiscall IceProxy::SWCCG::Auth::__createDelegateD(void)" (?__createDelegateD@Auth@SWCCG@IceProxy@@EAE?AV?$Handle@VObject@Ice@IceDelegateD@@@IceInternal@@XZ)
    client error LNK2001: unresolved external symbol "private: virtual class IceInternal::Handle<class IceDelegateD::Ice::Object> __thiscall IceProxy::SWCCG::Server::__createDelegateD(void)" (?__createDelegateD@Server@SWCCG@IceProxy@@EAE?AV?$Handle@VObject@Ice@IceDelegateD@@@IceInternal@@XZ)
    client error LNK2001: unresolved external symbol "private: virtual class IceInternal::Handle<class IceDelegateM::Ice::Object> __thiscall IceProxy::SWCCG::Auth::__createDelegateM(void)" (?__createDelegateM@Auth@SWCCG@IceProxy@@EAE?AV?$Handle@VObject@Ice@IceDelegateM@@@IceInternal@@XZ)
    client error LNK2001: unresolved external symbol "private: virtual class IceInternal::Handle<class IceDelegateM::Ice::Object> __thiscall IceProxy::SWCCG::Server::__createDelegateM(void)" (?__createDelegateM@Server@SWCCG@IceProxy@@EAE?AV?$Handle@VObject@Ice@IceDelegateM@@@IceInternal@@XZ)
    client error LNK2001: unresolved external symbol "void __cdecl IceInternal::decRef(class IceProxy::SWCCG::Server *)" (?decRef@IceInternal@@YAXPAVServer@SWCCG@IceProxy@@@Z)
    client error LNK2019: unresolved external symbol "public: class IceInternal::ProxyHandle<class IceProxy::SWCCG::Auth> __thiscall IceProxy::SWCCG::Server::getAuth(void)" (?getAuth@Server@SWCCG@IceProxy@@QAE?AV?$ProxyHandle@VAuth@SWCCG@IceProxy@@@IceInternal@@XZ) referenced in function "public: int __thiscall client::create(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >)" (?create@client@@QAEHV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z)
    client error LNK2019: unresolved external symbol "public: class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __thiscall IceProxy::SWCCG::Server::getMessages(struct SWCCG::Player const &)" (?getMessages@Server@SWCCG@IceProxy@@QAE?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@ABUPlayer@2@@Z) referenced in function "public: int __thiscall client::heartbeat(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >)" (?heartbeat@client@@QAEHV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z)
    client error LNK2019: unresolved external symbol "public: class std::vector<struct SWCCG::Card,class std::allocator<struct SWCCG::Card> > __thiscall IceProxy::SWCCG::Server::getCards(struct SWCCG::Player const &)" (?getCards@Server@SWCCG@IceProxy@@QAE?AV?$vector@UCard@SWCCG@@V?$allocator@UCard@SWCCG@@@std@@@std@@ABUPlayer@2@@Z) referenced in function "public: int __thiscall client::listCards(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >)" (?listCards@client@@QAEHV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z)
    client error LNK2019: unresolved external symbol "public: class std::vector<struct SWCCG::Player,class std::allocator<struct SWCCG::Player> > __thiscall IceProxy::SWCCG::Server::getList(void)" (?getList@Server@SWCCG@IceProxy@@QAE?AV?$vector@UPlayer@SWCCG@@V?$allocator@UPlayer@SWCCG@@@std@@@std@@XZ) referenced in function "public: int __thiscall client::list(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >)" (?list@client@@QAEHV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z)
    client error LNK2019: unresolved external symbol "public: int __thiscall IceProxy::SWCCG::Auth::create(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?create@Auth@SWCCG@IceProxy@@QAEHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@000@Z) referenced in function "public: int __thiscall client::create(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >)" (?create@client@@QAEHV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z)
    client error LNK2019: unresolved external symbol "public: int __thiscall IceProxy::SWCCG::Server::sendMessage(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?sendMessage@Server@SWCCG@IceProxy@@QAEHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z) referenced in function "public: int __thiscall client::invite(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >)" (?invite@client@@QAEHV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z)
    client error LNK2019: unresolved external symbol "public: int __thiscall IceProxy::SWCCG::Server::setAuth(class IceInternal::ProxyHandle<class IceProxy::SWCCG::Auth> const &)" (?setAuth@Server@SWCCG@IceProxy@@QAEHABV?$ProxyHandle@VAuth@SWCCG@IceProxy@@@IceInternal@@@Z) referenced in function "public: int __thiscall client::connect(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >)" (?connect@client@@QAEHV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z)
    client error LNK2019: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __cdecl IceProxy::SWCCG::Auth::ice_staticId(void)" (?ice_staticId@Auth@SWCCG@IceProxy@@SAABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "class IceInternal::ProxyHandle<class IceProxy::SWCCG::Auth> __cdecl IceInternal::checkedCastImpl<class IceInternal::ProxyHandle<class IceProxy::SWCCG::Auth> >(class IceInternal::ProxyHandle<class IceProxy::Ice::Object> const &)" (??$checkedCastImpl@V?$ProxyHandle@VAuth@SWCCG@IceProxy@@@IceInternal@@@IceInternal@@YA?AV?$ProxyHandle@VAuth@SWCCG@IceProxy@@@0@ABV?$ProxyHandle@VObject@Ice@IceProxy@@@0@@Z)
    client error LNK2019: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __cdecl IceProxy::SWCCG::Server::ice_staticId(void)" (?ice_staticId@Server@SWCCG@IceProxy@@SAABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "class IceInternal::ProxyHandle<class IceProxy::SWCCG::Server> __cdecl IceInternal::checkedCastImpl<class IceInternal::ProxyHandle<class IceProxy::SWCCG::Server> >(class IceInternal::ProxyHandle<class IceProxy::Ice::Object> const &)" (??$checkedCastImpl@V?$ProxyHandle@VServer@SWCCG@IceProxy@@@IceInternal@@@IceInternal@@YA?AV?$ProxyHandle@VServer@SWCCG@IceProxy@@@0@ABV?$ProxyHandle@VObject@Ice@IceProxy@@@0@@Z)
    *snip*
    Headers:
    Code:
    #include <Ice/Ice.h>
    
    //#ifdef _WIN32	
    //	#include <windows.h>
    //	#include <wtypes.h>
    //#endif
    // // Commenting out the above does not make a difference.
    
    #include <string>
    #include <vector>
    #include <iostream>
    #include <iomanip>
    #include <sstream>
    
    #include "client.h"
    
    #ifdef _WIN32
    #include "my_global.h"
    #endif
    #include "mysql.h"
    
    #include "client_help.h"
    Changing the libs to use defaults doesn't help.
    Alexander
    (School)Project: StarWars Customized Cardgame

  14. #14
    pokemoen is offline Registered User
    Name: Alex Man
    Organization: None
    Project: SWCCG
    Join Date
    May 2005
    Posts
    22
    PS.
    #ifdef _WIN32
    #include "my_global.h"
    #endif

    Seems to be the problem, since putting client.h above it produces the linker errors and below it produces the C2555.

    PPS. When I comment the above out, " #include "mysql.h" " does the same.
    Alexander
    (School)Project: StarWars Customized Cardgame

  15. #15
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    These link errors mean that you did not link with the .obj corresponding to the Ice generated code for SWCCG::Server, SWCCG::Auth etc, or a library that contains these .obj.

    For compile issues, the best is to post a simple test case that shows the problem.

    Cheers,
    Bernard
    Bernard Normier
    ZeroC, Inc.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 06-21-2010, 04:03 AM
  2. C# compile error!!
    By xpiao in forum Help Center
    Replies: 1
    Last Post: 11-19-2004, 04:06 PM
  3. compile error!
    By ouloba in forum Help Center
    Replies: 7
    Last Post: 09-23-2004, 11:41 PM
  4. Compile error
    By frostzero in forum Help Center
    Replies: 2
    Last Post: 05-07-2004, 04:09 PM
  5. Compile Error
    By threadsafe in forum Help Center
    Replies: 4
    Last Post: 07-24-2003, 09:32 PM

Posting Permissions

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