本文主要是介绍编译方法详见libjingle\README,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
http://hi.baidu.com/eve2006/item/df70f1e53e49ebadcf2d4fa3
编译方法详见libjingle\README
cmd:
安装python
set PYTHON=c:\Python27
(如果使用exe安装Scons则会安装到Python的目录里,
使用scons-2.1.0报错:TypeError: object of type 'Dir' has no len():,
使用scons-2.0.1进入编译,scons-2.0.1下载地址:http://www.ddxia.com/view/128928115336406.html,
参考资料:http://www.aiseminar.cn/bbs/forum.php?mod=viewthread&tid=1858)
#set SCONS_DIR=C:\Python27\Lib\site-packages\scons-2.1.0
set SCONS_DIR=C:\Python27\Lib\site-packages\scons-2.0.1
set PATH_TO_SWTOOLKIT=C:\1-MyWork\libjingle\depends\swtoolkit\swtoolkit
set PATH=%PYTHON%;%SCONS_DIR%;%PATH_TO_SWTOOLKIT%;%PATH%
拷贝expat、gtest、srtp到libjingle-...\talk\third_party
cd C:\1-MyWork\libjingle-...\talk
%PATH_TO_SWTOOLKIT%\hammer.bat
如果出现如下错误
scons: Building targets ...
________Compiling build\dbg\obj\xmpp\mucroomhistorytask.obj
mucroomhistorytask.cc
c:\1-mywork\libjingle\libjingle-0.6.10\talk\xmpp\mucroomhistorytask.cc : error C
2220: warning treated as error - no 'object' file generated
c:\1-mywork\libjingle\libjingle-0.6.10\talk\xmpp\mucroomhistorytask.cc : warning
C4819: The file contains a character that cannot be represented in the current
code page (936). Save the file in Unicode format to prevent data loss
scons: *** [build\dbg\obj\xmpp\mucroomhistorytask.obj] Error 2
scons: building terminated because of errors.
是由于注释当中的“,”引起,该字符是unicode编码,替换成ANSI编码即可
// <iq type='result'
//
// id='user-setting-1'>
// <meetinghistory xmlns='google:setting'>
// <item name=’Hangout'
// time=’2011-01-31T13:20:00Z’ />
// <item name=’Planning’
// time=’2011-02-11T 14:20:00Z />
// <item name=’TGIF’
// time=’2011-03-21T15:20:00Z’ />
// </meetinghistory>
// </iq>
cygwin:
#export PYTHON=/cygdrive/c/Python27
export SCONS_DIR=/cygdrive/c/1-MyWork/src/SCons/SCons-local-2.1.0/scons-local-2.1.0
export PATH_TO_SWTOOLKIT=/cygdrive/c/1-MyWork/src/swtoolkit/swtoolkit
#export PATH=$PYTHON:$SCONS_DIR:$PATH_TO_SWTOOLKIT:$PATH
export PATH=$SCONS_DIR:$PATH_TO_SWTOOLKIT:$PATH
$PATH_TO_SWTOOLKIT/hammer.sh
linux-ubuntu:
sudo apt-get install libgtk2.0-dev
sudo apt-get install libssl-dev
sudo apt-get install libasound2-dev
scons使用scons-local-2.0.1,下载并解压到某个目录
export SCONS_DIR=/home/leery/libjingle/depends/SCons/scons-local-2.0.1/scons-local-2.0.1
下载swtoolkit并解压到某个目录
export PATH_TO_SWTOOLKIT=/home/leery/libjingle/depends/swtoolkit/swtoolkit
export PATH=$SCONS_DIR:$PATH_TO_SWTOOLKIT:$PATH
下载expat-2.0.1并放到talk/third_party/目录下
cd talk/third_party/expat-2.0.1/
./configure
下载srtp并放到talk/third_party/目录下
cd ../srtp/
./configure
cd ../..
$PATH_TO_SWTOOLKIT/hammer.sh
如果出现如下错误
________Compiling build/dbg/obj/base/linux_unittest.o
base/linux_unittest.cc:32:32: error: testing/base/gunit.h: 没有那个文件或目录
base/linux_unittest.cc:38: error: ‘GetProcInfo’ has not been declared
base/linux_unittest.cc:38: error: ISO C++ forbids declaration of ‘TEST’ with no type
base/linux_unittest.cc: In function ‘int talk_base::TEST(talk_base::ProcCpuInfo, int)’:
base/linux_unittest.cc:40: error: ‘EXPECT_TRUE’ was not declared in this scope
base/linux_unittest.cc:45: error: ‘EXPECT_GT’ was not declared in this scope
base/linux_unittest.cc:51: error: ‘EXPECT_LE’ was not declared in this scope
base/linux_unittest.cc:56: error: ‘EXPECT_GE’ was not declared in this scope
base/linux_unittest.cc:78: error: ‘EXPECT_EQ’ was not declared in this scope
base/linux_unittest.cc:83: error: ‘EXPECT_FALSE’ was not declared in this scope
cc1plus: warnings being treated as errors
base/linux_unittest.cc:85: error: no return statement in function returning non-void
base/linux_unittest.cc: At global scope:
base/linux_unittest.cc:87: error: ‘ParseConfig’ has not been declared
base/linux_unittest.cc:87: error: ISO C++ forbids declaration of ‘TEST’ with no type
base/linux_unittest.cc: In function ‘int talk_base::TEST(talk_base::ConfigParser, int)’:
base/linux_unittest.cc:97: error: ‘EXPECT_EQ’ was not declared in this scope
base/linux_unittest.cc:106: error: no return statement in function returning non-void
base/linux_unittest.cc: At global scope:
base/linux_unittest.cc:108: error: expected constructor, destructor, or type conversion before ‘(’ token
base/linux_unittest.cc:114: error: expected constructor, destructor, or type conversion before ‘(’ token
scons: *** [build/dbg/obj/base/linux_unittest.o] Error 1
scons: building terminated because of errors.
打开talk/base/linux_unittest.cc,将
#include "testing/base/gunit.h"
改为
#include "talk/base/gunit.h"
即可
这篇关于编译方法详见libjingle\README的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!