|
|
|
|||||
|
how to use ICE in VC6.0??
always occur "Only multi-threaded DLL libraries can be used with Ice" error ??
I builded an ATL com project and have added include path/lib path(ice3.2.1 for VC6.0 had installed) What I have done something wrong? |
|
||||||
|
Hi,
It looks like you're using the wrong compiler settings to compile your application (most likely /ML or /MLd). You need to use the /MD or /MDd compiler option to compile Ice applications, see here for more information on these options. Cheers, Benoit. |
|
|||||
|
thanks for replying
but occur new problem... d:\ice-3.2.1-vc60\include\stlport\stl\debug\_vector.h(277) : error C2953: 'vector' : template class has already been defined how can I use "MS STL" and stlport lib at the same time( in ATL com project)? |
|
|||||
|
d:\ice-3.2.1-vc60\include\stlport\stl\debug\_debug.h(166) : warning C4005: '_STLP_DEBUG_CHECK' : macro redefinition
d:\ice-3.2.1-vc60\include\stlport\stl\_config.h(375) : see previous definition of '_STLP_DEBUG_CHECK' d:\ice-3.2.1-vc60\include\stlport\stl\debug\_debug.h(167) : warning C4005: '_STLP_DEBUG_DO' : macro redefinition d:\ice-3.2.1-vc60\include\stlport\stl\_config.h(376) : see previous definition of '_STLP_DEBUG_DO' d:\ice-3.2.1-vc60\include\stlport\stl\debug\_vector.h(277) : error C2953: 'vector' : template class has already been defined d:\ice-3.2.1-vc60\include\stlport\stl\debug\_vector.h(277) : see declaration of 'vector' d:\ice-3.2.1-vc60\include\ice\proxy.h(492) : error C2027: use of undefined type 'Object' d:\ice-3.2.1-vc60\include\ice\objectf.h(19) : see declaration of 'Object' d:\ice-3.2.1-vc60\include\ice\proxy.h(492) : error C2039: 'ice_facet' : is not a member of 'ProxyHandle<class Ice::Object>' d:\ice-3.2.1-vc60\include\ice\localexception.h(601) : error C2079: 'badMagic' uses undefined class 'vector<unsigned char,class _STL::allocator<unsigned char> >' Error executing cl.exe. |
|
|||||
|
new problem
.................................................. ................................. ice file module UVSPClient { struct USERINFO { string realname; string account; string nickname; string UUID; }; interface ClickObject { nonmutating bool isClicked(); nonmutating USERINFO getUserInfo(); bool isExist(string Account); bool register(UVSP::Platform::RegisterInfo RegInfo); int Validate(string Account,string Pwd); }; }; .................................................. ................................ ValidateClient.h // ValidateClient.h: interface for the CValidateClient class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_VALIDATECLIENT_H__980078BD_40E6_4661_ AEF8_327A3702476A__INCLUDED_) #define AFX_VALIDATECLIENT_H__980078BD_40E6_4661_AEF8_327A 3702476A__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CValidateClient : public UVSPClient::ClickObject { public: CValidateClient(); virtual ~CValidateClient(); public: static CValidateClient* getValidateClient(); virtual bool isClicked(const ::Ice::Current* current); virtual ::UVSPClient::USERINFO getUserInfo(const ::Ice::Current* current); virtual bool isExist(const ::std::string& Account, const ::Ice::Current* current); virtual bool _cpp_register(const ::UVSP::Platform::RegisterInfo& RegInfo, const ::Ice::Current* current); virtual ::Ice::Int Validate(const ::std::string& Account, const ::std::string& pwd, const ::Ice::Current* current); private: static CValidateClient* _pthis; }; #endif // !defined(AFX_VALIDATECLIENT_H__980078BD_40E6_4661_ AEF8_327A3702476A__INCLUDED_) .................................................. ........................................ .cpp // ValidateClient.cpp: implementation of the CValidateClient class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "ValidateClient.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CValidateClient* CValidateClient::_pthis = NULL; CValidateClient::CValidateClient() { } CValidateClient::~CValidateClient() { } CValidateClient* CValidateClient::getValidateClient() { if(_pthis == NULL) // _pthis = new CValidateClient(); return _pthis; } bool CValidateClient::isClicked(const ::Ice::Current* current) { return true; } UVSPClient::USERINFO CValidateClient::getUserInfo(const ::Ice::Current* current) { UVSPClient::USERINFO ui; return ui; } bool CValidateClient::isExist(const ::std::string& Account, const ::Ice::Current* current) { return true; } bool CValidateClient::_cpp_register(const ::UVSP::Platform::RegisterInfo& RegInfo, const ::Ice::Current* current) { return true; } Ice::Int CValidateClient::Validate(const ::std::string& Account, const ::std::string& pwd, const ::Ice::Current* current) { return 0; } ............................................. Compiling... ValidateClient.cpp E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : error C2259: 'CValidateClient' : cannot instantiate abstract class due to following members: E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.h(12) : see declaration of 'CValidateClient' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::isClicked(const struct Ice::Current &) const' : pure virtual function was not defined .\ice cpp file\UVSPClickObjectC.h(325) : see declaration of 'isClicked' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'struct UVSPClient::USERINFO __thiscall UVSPClient::ClickObject::getUserInfo(const struct Ice::Current &) const' : pure virtual function wa s not defined .\ice cpp file\UVSPClickObjectC.h(328) : see declaration of 'getUserInfo' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::isExist(const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<c har> > &,const struct Ice::Current &)' : pure virtual function was not defined .\ice cpp file\UVSPClickObjectC.h(331) : see declaration of 'isExist' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::_cpp_register(const struct UVSP::Platform::RegisterInfo &,const struct Ice::Current &)' : pure vi rtual function was not defined .\ice cpp file\UVSPClickObjectC.h(334) : see declaration of '_cpp_register' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'int __thiscall UVSPClient::ClickObject::Validate(const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<c har> > &,const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > &,const struct Ice::Current &)' : pure virtual function was not defined .\ice cpp file\UVSPClickObjectC.h(337) : see declaration of 'Validate' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : error C2259: 'CValidateClient' : cannot instantiate abstract class due to following members: E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.h(12) : see declaration of 'CValidateClient' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::isClicked(const struct Ice::Current &) const' : pure virtual function was not defined .\ice cpp file\UVSPClickObjectC.h(325) : see declaration of 'isClicked' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'struct UVSPClient::USERINFO __thiscall UVSPClient::ClickObject::getUserInfo(const struct Ice::Current &) const' : pure virtual function wa s not defined .\ice cpp file\UVSPClickObjectC.h(328) : see declaration of 'getUserInfo' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::isExist(const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<c har> > &,const struct Ice::Current &)' : pure virtual function was not defined .\ice cpp file\UVSPClickObjectC.h(331) : see declaration of 'isExist' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::_cpp_register(const struct UVSP::Platform::RegisterInfo &,const struct Ice::Current &)' : pure vi rtual function was not defined .\ice cpp file\UVSPClickObjectC.h(334) : see declaration of '_cpp_register' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'int __thiscall UVSPClient::ClickObject::Validate(const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<c har> > &,const class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > &,const struct Ice::Current &)' : pure virtual function was not defined .\ice cpp file\UVSPClickObjectC.h(337) : see declaration of 'Validate' Error executing cl.exe. UVSP CLib.dll - 2 error(s), 10 warning(s) .................................................. . what 's wrong??? |
|
||||||
|
Hi,
Check the declaration of the methods in UVSPClickObjectC.h, you'll see that they don't match the declaration of the methods in your class defined in ValidateClient.h. Specifically, const ::Ice::Current* current should be const ::Ice::Current& current. Cheers, Benoit. |
|
|||||
|
I have corrected from "const Ice::Current*" to "const Ice::Current&",but the problem also exist!
.................................................. ............... ice file module UVSPClient { struct USERINFO { string realname; string account; string nickname; string UUID; }; interface ClickObject { nonmutating bool isClicked(); nonmutating USERINFO getUserInfo(); bool isExist(string Account); bool Register(UVSP::Platform::RegisterInfo RegInfo); int Validate(string Account,string Pwd); }; }; .................................................. .............. .h file // ValidateClient.h: interface for the CValidateClient class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_VALIDATECLIENT_H__980078BD_40E6_4661_ AEF8_327A3702476A__INCLUDED_) #define AFX_VALIDATECLIENT_H__980078BD_40E6_4661_AEF8_327A 3702476A__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CValidateClient : public UVSPClient::ClickObject { public: CValidateClient(); virtual ~CValidateClient(); public: static CValidateClient* getValidateClient(); public: virtual bool isClicked(const ::Ice::Current& current); virtual ::UVSPClient::USERINFO getUserInfo(const ::Ice::Current& current); virtual bool isExist(const ::std::string& Account, const ::Ice::Current& current); virtual bool Register(const ::UVSP::Platform::RegisterInfo& RegInfo, const ::Ice::Current& current); virtual ::Ice::Int Validate(const ::std::string& Account, const ::std::string& pwd, const ::Ice::Current& current); private: static CValidateClient* _pthis; }; #endif // !defined(AFX_VALIDATECLIENT_H__980078BD_40E6_4661_ AEF8_327A3702476A__INCLUDED_) .................................................. .................. .cpp file // ValidateClient.cpp: implementation of the CValidateClient class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "ValidateClient.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CValidateClient* CValidateClient::_pthis = NULL; CValidateClient::CValidateClient() { } CValidateClient::~CValidateClient() { } CValidateClient* CValidateClient::getValidateClient() { if(_pthis == NULL) _pthis = new CValidateClient(); return _pthis; } bool CValidateClient::isClicked(const ::Ice::Current& current) { return true; } UVSPClient::USERINFO CValidateClient::getUserInfo(const ::Ice::Current& current) { UVSPClient::USERINFO ui; return ui; } bool CValidateClient::isExist(const ::std::string& Account, const ::Ice::Current& current) { return true; } bool CValidateClient::Register(const ::UVSP::Platform::RegisterInfo& RegInfo, const ::Ice::Current& current) { return true; } Ice::Int CValidateClient::Validate(const ::std::string& Account, const ::std::string& pwd, const ::Ice::Current& current) { return 0; } .................................................. ..................... Compiling... ValidateClient.cpp E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : error C2259: 'CValidateClient' : cannot instantiate abstract class due to following members: e:\ffcs之旅\dce project\5_rd\3_mk\uvsp源码\client class lib\uvsp clib\validateclient.h(12) : see declaration of 'CValidateClient' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::isClicked(const struct Ice::Current &) const' : pure virtual function was not defined e:\ffcs之旅\dce project\5_rd\3_mk\uvsp源码\client class lib\uvsp clib\ice cpp file\uvspclickobjectc.h(325) : see declaration of 'isClicked' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'struct UVSPClient::USERINFO __thiscall UVSPClient::ClickObject::getUserInfo(const struct Ice::Current &) const' : pure virtual function wa s not defined e:\ffcs之旅\dce project\5_rd\3_mk\uvsp源码\client class lib\uvsp clib\ice cpp file\uvspclickobjectc.h(328) : see declaration of 'getUserInfo' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : error C2259: 'CValidateClient' : cannot instantiate abstract class due to following members: e:\ffcs之旅\dce project\5_rd\3_mk\uvsp源码\client class lib\uvsp clib\validateclient.h(12) : see declaration of 'CValidateClient' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'bool __thiscall UVSPClient::ClickObject::isClicked(const struct Ice::Current &) const' : pure virtual function was not defined e:\ffcs之旅\dce project\5_rd\3_mk\uvsp源码\client class lib\uvsp clib\ice cpp file\uvspclickobjectc.h(325) : see declaration of 'isClicked' E:\ffcs之旅\DCE project\5_RD\3_MK\UVSP源码\Client Class Lib\UVSP CLib\ValidateClient.cpp(26) : warning C4259: 'struct UVSPClient::USERINFO __thiscall UVSPClient::ClickObject::getUserInfo(const struct Ice::Current &) const' : pure virtual function wa s not defined e:\ffcs之旅\dce project\5_rd\3_mk\uvsp源码\client class lib\uvsp clib\ice cpp file\uvspclickobjectc.h(328) : see declaration of 'getUserInfo' Error executing cl.exe. UVSP CLib.dll - 2 error(s), 4 warning(s) ?????????????????????????????????? what 's wrong? ![]() |
|
||||||
|
The declaration of your methods doesn't match the one from UVSPClient::ClickObject defined in the uvspclickobjectc.h header. You should open this header file and check the lines given by the compiler to see the expected declaration (line 325 and 328).
Most likely, the problem is caused by a missing "const" at the end of the method declaration since you've declared the methods as "nonmutating". Btw, you shouldn't use the "nonmutating" keyword: it has been deprecated. Instead you should use "idempotent" and ["cpp:const"], for example: Code:
// Slice ["cpp:const"] idempotent bool isClicked(); Benoit. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ice client coredump on VC6.0 | richardma | Help Center | 2 | 02-22-2006 08:58 PM |
| how can i compile ice file in vc6 IDE ? | memorialday | Help Center | 2 | 11-22-2005 08:05 AM |
| error when use ice 2.1 and vc6.0 | ralf3 | Help Center | 3 | 03-18-2005 09:18 AM |
| Problem when use ice 2.1 and ace on vc6.0! help! | ralf3 | Help Center | 9 | 03-17-2005 11:51 PM |
| Strange compilation error with VC6 / Ice 1.4.0 | annekat | Help Center | 3 | 07-05-2004 02:15 PM |