对照libjingle.scons创建项目
talk.Library 创建static lib项目
talk.App创建console项目
把srcs中的文件添加到vs中
cppdefines,win_cppdefines添加到vs project properties->c/c++->preprocessor ->preprocessor definitions
includedirs添加到vs project properties->c/c++->gengeral->addtional include dir
win_ccflags可以添加到vs project properties->c/c++->command line->addtional options
libs设置为vs project dependencies
P.S.
main.scons里面的设置选项也需要参考,但是我没有设置进项目的vs工程里面;不知道会不会有问题
只要有耐心,其实很简单就能编译通过,link时会出现一些错误;我遇到的问题列出如下,基本能解决掉全部问题。(只为自己做个记录,格式凌乱请见谅)
error LNK2019: unresolved external symbol __imp__waveOutGetDevCapsW
加入 Winmm.lib
error LNK2019: unresolved external symbol _InitializeSecurityContextA@48 referenced in function "public: virtual bool __thiscall gloox::SChannel::handshake(void)" (?
error LNK2019: unresolved external symbol _InitializeSecurityContextA@48 referenced in function "protected: int __thiscall talk_base::SChannelAdapter::BeginSSL(void)" (?BeginSSL@SChannelAdapter@talk_base@@IAEHXZ)
secur32.lib
error LNK2001: unresolved external symbol _CLSID_VideoInputDeviceCategory
error LNK2001: unresolved external symbol _CLSID_SystemDeviceEnum
strmiids.lib
nresolved external symbol __imp__InternetQueryOption
Wininet.lib
qname
error LNK2001: unresolved external symbol "char const * const cricket::STR_TERMINATE_SUCCESS" (?STR_TERMINATE_SUCCESS@cricket@@3QBDB)
talk\p2p\base\constants.cc
talk\xmpp\constants.cc
生成constants.obj重名了
-->选择任意一个constants.cc文件,修改它的obj输出目录,c/c++->output files->object file name->$(IntDir)\p2p\base\
1. error LNK2019: unresolved external symbol __imp__htonl@4 referenced in function "public: __thiscall talk_base::IPAddress::IPAddress(unsigned int)" (??0IPAddress@talk_base@@QAE@I@Z)
ws2_32.lib
2. error LNK2019: unresolved external symbol __imp__CryptFindOIDInfo@12 referenced in function "protected: int __thiscall talk_base::SChannelAdapter::BeginSSL(void)" (?BeginSSL@SChannelAdapter@talk_base@@IAEHXZ)
crypt32.lib
error LNK2019: unresolved external symbol _GetAdaptersInfo@8 referenced in function "protected: static bool __cdecl talk_base::BasicNetworkManager::CreateNetworks(bool,class std::vector<class talk_base::Network *,class std::allocator<class talk_base::Network *> > *)" (?CreateNetworks@BasicNetworkManager@talk_base@@KA_N_NPAV?$vector@PAVNetwork@talk_base@@V?$allocator@PAVNetwork@talk_base@@@std@@@std@@@Z)
Iphlpapi.lib