Archived
This forum has been archived. Please start a new discussion on GitHub.
Compile gives error C2555
pokemoen
in Help Center
Hello, I was wondering if someone could help me with this.
In VC7.1 I compile and get:
The code where the first error points to: (slice2cpp generated SWCCG.h)
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
In VC7.1 I compile and get:
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)
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
0
Comments
-
It occurs when compiling client.cpp, which includes client.h, which in turn includes SWCCG.h.
Here's client.h#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,0 -
Woops
#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..0 -
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: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:#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.0
