我目前正在开发JavaScript,并希望为JavaScript设计单元测试,我使用的是google test。
http://code.google.com/p/google-js-test/
我下载了gjstest-1.0.7
我已经安装了所需的所有先决条件。
http://code.google.com/p/google-js-test/wiki/Installing#Prerequisites
但是当我安装google js测试时,使用
$ cd gjstest-1.0.7
$ make我有以下错误
g++ -DHASH_NAMESPACE=__gnu_cxx -lrt -I. -I/usr/include/libxml2 -DDEFAULT_DATA_DIR=/usr/local/share/gjstest -c -o gjstest/internal/cpp/v8_utils.o gjstest/internal/cpp/v8_utils.cc
gjstest/internal/cpp/v8_utils.cc:33: error: ‘v8::StackFrame’ has not been declared
gjstest/internal/cpp/v8_utils.cc:34: error: ‘v8::StackTrace’ has not been declared
gjstest/internal/cpp/v8_utils.cc: In function ‘void gjstest::ConvertToStringVector(const v8::Handle<v8::Value>&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*)’:
gjstest/internal/cpp/v8_utils.cc:60: error: no matching function for call to ‘v8::Array::Get(uint32&)’
/usr/include/v8.h:1161: note: candidates are: v8::Local<v8::Value> v8::Object::Get(v8::Handle<v8::Value>)
make: *** [gjstest/internal/cpp/v8_utils.o] Error 1看来v8的安装不正确
我使用以下命令安装了V8
sudo apt-get install libv8-2.0.3
sudo apt-get install libv8-dbg
sudo apt-get install libv8-dev 也可以通过下载
svn checkout http://v8.googlecode.com/svn/trunk/ v8
cd v8
make dependencies
scons但还是会犯这些错误
因此,如果有人安装和使用Google或安装了v8,请指导我如何解决这个问题。
我正在使用Ubuntu10.04。任何帮助都将不胜感激。
发布于 2012-08-27 20:08:53
这确实是因为试图针对一个非常老版本的libv8构建gjstest。
我在ubuntu10.04上签出并构建了一个最新的libv8,按照这里的说明
svn checkout http://v8.googlecode.com/svn/trunk/ v8
cd v8
make depdendencies
make native library=shared
cp out/native/lib.target/libv8.so /usr/local/lib/libv8.so
cp include/v8.h /usr/local/include/v8.h
cp include/v8stdint.h /usr/local/include/v8stdint.h之后,gjstest编译并运行,没有进一步的意外。
https://stackoverflow.com/questions/11132430
复制相似问题