우분투에서 V8을 컴파일했고 isolate_test.cc라는 매우 간단한 V8 프로그램이 있습니다. 그것은 Hello World example from Google을 기반으로합니다V8에서 Isolate :: GetCurrent()가 NULL을 반환하는 이유는 무엇입니까?
는#include <v8.h>
using namespace v8;
int main(int argc, char* argv[]) {
V8::initialize();
Isolate* isolate = Isolate::GetCurrent(); //Always returns NULL
return 0;
}
나는이 프로그램을 컴파일하는 데 사용하는 명령은 다음과 같습니다
g++ -Iinclude -g isolate_test.cc -o isolate_test -Wl,--start-group out/x64.debug/obj.target/{tools/gyp/libv8_{base,snapshot},third_party/icu/libicu{uc,i18n,data}}.a -Wl,--end-group -lrt -lpthread
문제는 항상 Isolate::GetCurrent()
입니다 NULL
를 반환합니다. 왜 이런 일이 일어나고 현재의 올바른 방법은 무엇입니까 Isolate
?
나는 길을 벗어날 수 있지만 내 생각은 이 현재 스레드를 libpthread
에서 가져올 수 없다는 것입니다.
업데이트 : 프로그램의 첫 번째 통화로 V8::initialize()
을 추가 한this question 당 그러나이 방법으로 문제가 해결되지 않습니다.
는 참조 http://stackoverflow.com/questions/16924087/segfault-in-v8-on-windows-in-handlescope-constructor, 당신은 아마 누락 V8 :: initialize() 호출; 이것은 예제의 문서 버그 일 수도 있습니다. – nos
'V8 :: initialize()'에 대한 참조를 찾을 수 없습니다 - API에서 제거 되었습니까? – donturner
링크가 [Isolate :: GetCurrent()] 파일에 정의되어 있지만 (https://code.google.com/p/v8/codesearch#v8/trunk/src/api.cc&q=) % 3a % 격리 됨 % 28 % 29 & sq = 패키지 % 3av8 & l = 6523) – nos