Posted on 2010-06-17 12:09
S.l.e!ep.¢% 閱讀(624)
評論(0) 編輯 收藏 引用 所屬分類:
ICE
加入 #include <IceSSL/Plugin.h> 后出現
??? error C2011: 'fd_set' : 'struct' type redefinition ......
google找到相關的解決方案
#if?!defined(NDEBUG)?&&?!defined(_STLP_DEBUG)
#?define?_STLP_DEBUG
#endif
#ifndef?_WIN32_WINNT
#???define?_WIN32_WINNT?0x400
#endif
#include?<winsock2.h>
#include?<Ice/Ice.h>
#include?<IceSSL/Plugin.h>
#include?<stdlib.h>
#include?<stdio.h>
#pragma?comment(lib,?"Iced.lib")
#pragma?comment(lib,?"IceUtild.lib")
使用前,先要進行如下設置:
添加/GR編譯選項 Enable C++ RTTI。
添加ice的include、
StlPort的include、ice的lib路徑,并將這些路徑提到最前,以免與VC的沖突。
為Link Object/Library
modles 加上iced.lib iceutild.lib 。
1、編譯中出現
Linking
LINK?:?fatal?error?LNK1104:?cannot?open?file?"stlport_vc6_static.lib"
Error?executing?link.exe.解決辦法:
Porject->Setting->C++->CodeGeneration
設置Use Run-time library=Debug Multithreaded DLL
2、編譯中出現
?
warning?C4005:?'_STLP_DEBUG_CHECK'?:?macro?redefinition解
決辦法:在包含ice/ice.h之前添加以下代碼
#if?!defined(NDEBUG)?&&?!defined(_STLP_DEBUG)
#?define?_STLP_DEBUG
#endif3、
編譯中出現
error?C2065:?'TryEnterCriticalSection'?:?undeclared?identifier解
決辦法:
在stdafx.h中,加上
#ifndef?_WIN32_WINNT
#???define?_WIN32_WINNT?0x400
#endif4、
編譯中出現
error?LNK2001:?unresolved?external?symbol?"__declspec(dllimport)?public:?__thiscall?IceUtil::GCRecMutexInit::GCRecMutexInit(void)"?(__imp_??0GCRecMutexInit@IceUtil@@QAE@XZ)
error?LNK2001:?unresolved?external?symbol?"__declspec(dllimport)?public:?__thiscall?IceUtil::GCRecMutexInit::~GCRecMutexInit(void)"?(__imp_??1GCRecMutexInit@IceUtil@@QAE@XZ)
D解決辦法:
Porject->Setting->Link->
Object/Library modles:加上iced.lib iceutild.lib
5、編譯中出現
error?C2061:?syntax?error?:?identifier?'SC_HANDLE'
error?C2061:?syntax?error?:?identifier?'SERVICE_STATUS'
error?C2146:?syntax?error?:?missing?';'?before?identifier?'_statusHandle'
error?C2501:?'SERVICE_STATUS_HANDLE'?:?missing?storage-class?or?type?specifiers
error?C2501:?'_statusHandle'?:?missing?storage-class?or?type?specifiers
error?C2146:?syntax?error?:?missing?';'?before?identifier?'_status'
error?C2501:?'SERVICE_STATUS'?:?missing?storage-class?or?type?specifiers
error?C2501:?'_status'?:?missing?storage-class?or?type?specifiers解
決辦法:
在stdafx.h或其他文件中增加
#include??<WINSVC.H>作
者:李珍寶(
http://zhenbaodao51.51.net?,
http://www.lizhenbao.com ,
http://www.cnitblog.com/lizhenbao/?),
轉載請注明出處
完。