fake-node
fake-node copied to clipboard
hello-world的例子失败
编译环境:
OS: macOS High Sierra 10.13.6 17G65 x86_64
Clang:
Apple LLVM version 9.1.0 (clang-902.0.39.2) Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
XCode版本:Version 9.4.1 (9F2000)
执行您的README中的编译hello world的命令:
clang++ -stdlib=libstdc++ -std=c++11 -I. hello_world.cpp -o hello_world out/x64.release/libv8_base.a out/x64.release/libv8_libbase.a out/x64.release/libicudata.a out/x64.release/libicuuc.a out/x64.release/libicui18n.a out/x64.release/libv8_base.a out/x64.release/libv8_external_snapshot.a out/x64.release/libv8_libplatform.a
报错如下:
clang: warning: libstdc++ is deprecated; move to libc++ [-Wdeprecated]
ld: warning: ignoring file out/x64.release/libv8_base.a, file was built for unsupported file format ( 0x76 0x65 0x72 0x73 0x69 0x6F 0x6E 0x20 0x68 0x74 0x74 0x70 0x73 0x3A 0x2F 0x2F ) which is not the architecture being linked (x86_64): out/x64.release/libv8_base.a
Undefined symbols for architecture x86_64:
"v8::HandleScope::HandleScope(v8::Isolate*)", referenced from:
_main in hello_world-1b2db9.o
"v8::HandleScope::~HandleScope()", referenced from:
_main in hello_world-1b2db9.o
"v8::ResourceConstraints::ResourceConstraints()", referenced from:
v8::Isolate::CreateParams::CreateParams() in hello_world-1b2db9.o
"v8::V8::Initialize()", referenced from:
_main in hello_world-1b2db9.o
"v8::V8::ToLocalEmpty()", referenced from:
_main in hello_world-1b2db9.o
"v8::V8::InitializeICU(char const*)", referenced from:
_main in hello_world-1b2db9.o
"v8::V8::ShutdownPlatform()", referenced from:
_main in hello_world-1b2db9.o
"v8::V8::InitializePlatform(v8::Platform*)", referenced from:
_main in hello_world-1b2db9.o
"v8::V8::InitializeExternalStartupData(char const*)", referenced from:
_main in hello_world-1b2db9.o
"v8::V8::Dispose()", referenced from:
_main in hello_world-1b2db9.o
"v8::Script::Run(v8::Local<v8::Context>)", referenced from:
_main in hello_world-1b2db9.o
"v8::Script::Compile(v8::Local<v8::Context>, v8::Local<v8::String>, v8::ScriptOrigin*)", referenced from:
_main in hello_world-1b2db9.o
"v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int)", referenced from:
_main in hello_world-1b2db9.o
"v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)", referenced from:
_main in hello_world-1b2db9.o
"v8::String::Utf8Value::~Utf8Value()", referenced from:
_main in hello_world-1b2db9.o
"v8::Context::New(v8::Isolate*, v8::ExtensionConfiguration*, v8::Local<v8::ObjectTemplate>, v8::Local<v8::Value>)", referenced from:
_main in hello_world-1b2db9.o
"v8::Context::Exit()", referenced from:
_main in hello_world-1b2db9.o
"v8::Context::Enter()", referenced from:
_main in hello_world-1b2db9.o
"v8::Isolate::New(v8::Isolate::CreateParams const&)", referenced from:
_main in hello_world-1b2db9.o
"v8::Isolate::Exit()", referenced from:
v8::Isolate::Scope::~Scope() in hello_world-1b2db9.o
"v8::Isolate::Enter()", referenced from:
v8::Isolate::Scope::Scope(v8::Isolate*) in hello_world-1b2db9.o
"v8::Isolate::Dispose()", referenced from:
_main in hello_world-1b2db9.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
是我有什么地方没有配置吗?我在谷歌百度也没有查到符合的解决方法。 希望您能解答,谢谢!