我想在我的计算机上安装 Less 编译器,但是当我运行以下命令时:
sudo gem install less
并且 make 命令停止了以下错误:
g++ -shared -o v8.so v8_locker.o v8_debug.o v8_date.o v8_object.o v8.o rr.o v8_context.o v8_value.o v8_script.o v8_v8.o v8_callbacks.o v8_handle.o v8_weakref.o v8_template.o v8_message.o v8_function.o v8_string.o v8_array.o v8_try_catch.o v8_external.o v8_exception.o -L/home/segi/.gem/ruby/1.9.1/gems/libv8-3.3.10.2/lib/libv8/build/v8 -L. -L/usr/lib -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -lruby-1.9.1 -lpthread -lpthread -lrt -ldl -lcrypt -lm -lc -lv8
/usr/bin/ld: cannot find -lv8
collect2: ld returned 1 exit status
make: *** [v8.so] Error 1
缺少哪个包?或者是什么问题?谢谢您的回答!
sudo apt-get install libv8-dev
这是一个好的包,但现在我收到以下错误:
g++ -I. -I/usr/include/ruby-1.9.1/i486-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -D_FILE_OFFSET_BITS=64 -Wall -g -rdynamic -fPIC -fno-strict-aliasing -g -g -O2 -O2 -g -Wall -Wno-parentheses -fPIC -fno-strict-aliasing -g -o v8_template.o -c v8_template.cpp
In file included from v8_template.cpp:1:
rr.h:30: error: ‘StackTrace’ is not a member of ‘v8’
rr.h:30: error: ‘StackTrace’ is not a member of ‘v8’
rr.h:30: error: template argument 1 is invalid
rr.h:31: error: ‘StackFrame’ is not a member of ‘v8’
rr.h:31: error: ‘StackFrame’ is not a member of ‘v8’
rr.h:31: error: template argument 1 is invalid
v8_template.cpp: In function ‘VALUE<unnamed>::Obj::SetNamedPropertyHandler(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)’:
v8_template.cpp:254: error: invalid conversion from ‘v8::Handle<v8::Integer> (*)(v8::Local<v8::String>, const v8::AccessorInfo&)’ to ‘v8::Handle<v8::Boolean> (*)(v8::Local<v8::String>, const v8::AccessorInfo&)’
v8_template.cpp:254: error: initializing argument 3 of ‘void v8::ObjectTemplate::SetNamedPropertyHandler(v8::Handle<v8::Value> (*)(v8::Local<v8::String>, const v8::AccessorInfo&), v8::Handle<v8::Value> (*)(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo&), v8::Handle<v8::Boolean> (*)(v8::Local<v8::String>, const v8::AccessorInfo&), v8::Handle<v8::Boolean> (*)(v8::Local<v8::String>, const v8::AccessorInfo&), v8::Handle<v8::Array> (*)(const v8::AccessorInfo&), v8::Handle<v8::Value>)’
v8_template.cpp: In function ‘VALUE<unnamed>::Obj::SetIndexedPropertyHandler(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)’:
v8_template.cpp:271: error: invalid conversion from ‘v8::Handle<v8::Integer> (*)(uint32_t, const v8::AccessorInfo&)’ to ‘v8::Handle<v8::Boolean> (*)(uint32_t, const v8::AccessorInfo&)’
v8_template.cpp:271: error: initializing argument 3 of ‘void v8::ObjectTemplate::SetIndexedPropertyHandler(v8::Handle<v8::Value> (*)(uint32_t, const v8::AccessorInfo&), v8::Handle<v8::Value> (*)(uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo&), v8::Handle<v8::Boolean> (*)(uint32_t, const v8::AccessorInfo&), v8::Handle<v8::Boolean> (*)(uint32_t, const v8::AccessorInfo&), v8::Handle<v8::Array> (*)(const v8::AccessorInfo&), v8::Handle<v8::Value>)’
make: *** [v8_template.o] Error 1
答案1
听起来好像缺少 v8 开发标头。尝试安装 libv8-dev 包,
sudo apt-get install libv8-dev
。