昨天去谷歌官网download了个V8的源码,按教程编了下
scons mode=debug library=shared snapshot=on
scons sample=shell
scons d8
木有问题,然后,把它的例子代码hello_world也copy下来编了一下
g++ -Iinclude hello_world.cpp -o hello_world libv8.a -lpthread
果断出错,编的机器都要哭了,还是没编过。。。求高人指点,本人64位UBUNTU系统。
错误提示如下例:
libv8.a(platform-linux.o): In function `v8::internal::OS::MemoryMappedFile::open(char const*)':
platform-linux.cc:(.text._ZN2v88internal2OS16MemoryMappedFile4openEPKc+0x8b): undefined reference to `operator new(unsigned int)'
libv8.a(platform-linux.o): In function `global constructors keyed to _ZN2v88internal7ceilingEd':
platform-linux.cc:(.text._GLOBAL__I__ZN2v88internal7ceilingEd+0x17): undefined reference to `operator new(unsigned int)'
libv8.a(platform-linux.o): In function `v8::internal::OS::Setup()':
platform-linux.cc:(.text._ZN2v88internal2OS5SetupEv+0x4c): undefined reference to `operator new(unsigned int)'
libv8.a(platform-linux.o): In function `v8::internal::Sampler::Start()':
platform-linux.cc:(.text._ZN2v88internal7Sampler5StartEv+0x7b): undefined reference to `operator new(unsigned int)'
libv8.a(platform-posix.o):platform-posix.cc:(.text._ZN2v88internal2OS12CreateSocketEv+0xc): more undefined references to `operator new(unsigned int)' follow
libv8.a(preparse-data.o): In function `v8::internal::CompleteParserRecorder::CompleteParserRecorder()':
preparse-data.cc:(.text._ZN2v88internal22CompleteParserRecorderC2Ev+0x4e): undefined reference to `operator new[](unsigned int)'
preparse-data.cc:(.text._ZN2v88internal22CompleteParserRecorderC2Ev+0xdf): undefined reference to `operator new[](unsigned int)'
preparse-data.cc:(.text._ZN2v88internal22CompleteParserRecorderC2Ev+0x138): undefined reference to `operator new[](unsigned int)'
preparse-data.cc:(.text._ZN2v88internal22CompleteParserRecorderC2Ev+0x1a6): undefined reference to `operator new[](unsigned int)'
libv8.a(preparse-data.o): In function `v8::internal::FunctionLoggingParserRecorder::FunctionLoggingParserRecorder()':
preparse-data.cc:(.text._ZN2v88internal29FunctionLoggingParserRecorderC1Ev+0x4e): undefined reference to `operator new[](unsigned int)'
字数有限制,就复制这么多吧,其实一屏的错误拉不完。。。
------解决方案--------------------
顶一个。。。