Hi, I solved this problem under your guys help, Thank you so much! 在2020年12月15日星期二 UTC+8 下午6:13:07<Zhi An Ng> 写道:
> On Tue, Dec 15, 2020 at 5:18 PM Ricky Du <dwtfro...@gmail.com> wrote: > >> But I got another error: >> >> >> I was using this to compile: >> g++ -I. -Iinclude samples/hello-world.cc -o hello_world >> -Lout.gn/x64.release/obj/ -lrt -ldl -pthread -std=c++14 >> -DV8_COMPRESS_POINTERS >> > > Hi, > > Are you using `gm.py` to set this up? If you are, you can use `ninja -C > out/x64.release/ v8_hello_world` to compile this, that should help you get > the right header files. > > >> >> And I got this error: >> >> /tmp/ccIoFwWc.o: In function `main': >> hello-world.cc:(.text+0x2c): undefined reference to >> `v8::V8::InitializeICUDefaultLocation(char const*, char const*)' >> hello-world.cc:(.text+0x3e): undefined reference to >> `v8::V8::InitializeExternalStartupData(char const*)' >> hello-world.cc:(.text+0x75): undefined reference to >> `v8::platform::NewDefaultPlatform(int, v8::platform::IdleTaskSupport, >> v8::platform::InProcessStackDumping, std::unique_ptr<v8::TracingController, >> std::default_delete<v8::TracingController> >)' >> hello-world.cc:(.text+0x9b): undefined reference to >> `v8::V8::InitializePlatform(v8::Platform*)' >> hello-world.cc:(.text+0xac): undefined reference to >> `v8::V8::Initialize(int)' >> hello-world.cc:(.text+0xbb): undefined reference to >> `v8::Isolate::CreateParams::CreateParams()' >> hello-world.cc:(.text+0xc0): undefined reference to >> `v8::ArrayBuffer::Allocator::NewDefaultAllocator()' >> hello-world.cc:(.text+0xd6): undefined reference to >> `v8::Isolate::New(v8::Isolate::CreateParams const&)' >> hello-world.cc:(.text+0x106): undefined reference to >> `v8::HandleScope::HandleScope(v8::Isolate*)' >> hello-world.cc:(.text+0x16e): undefined reference to >> `v8::Context::New(v8::Isolate*, v8::ExtensionConfiguration*, >> v8::MaybeLocal<v8::ObjectTemplate>, v8::MaybeLocal<v8::Value>, >> v8::DeserializeInternalFieldsCallback, v8::MicrotaskQueue*)' >> hello-world.cc:(.text+0x1af): undefined reference to >> `v8::Context::Enter()' >> hello-world.cc:(.text+0x1ea): undefined reference to >> `v8::Script::Compile(v8::Local<v8::Context>, v8::Local<v8::String>, >> v8::ScriptOrigin*)' >> hello-world.cc:(.text+0x20b): undefined reference to >> `v8::V8::ToLocalEmpty()' >> hello-world.cc:(.text+0x248): undefined reference to >> `v8::Script::Run(v8::Local<v8::Context>)' >> hello-world.cc:(.text+0x269): undefined reference to >> `v8::V8::ToLocalEmpty()' >> hello-world.cc:(.text+0x2aa): undefined reference to >> `v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)' >> hello-world.cc:(.text+0x2d0): undefined reference to >> `v8::String::Utf8Value::~Utf8Value()' >> hello-world.cc:(.text+0x357): undefined reference to >> `v8::Script::Compile(v8::Local<v8::Context>, v8::Local<v8::String>, >> v8::ScriptOrigin*)' >> hello-world.cc:(.text+0x378): undefined reference to >> `v8::V8::ToLocalEmpty()' >> hello-world.cc:(.text+0x3af): undefined reference to >> `v8::Script::Run(v8::Local<v8::Context>)' >> hello-world.cc:(.text+0x3d0): undefined reference to >> `v8::V8::ToLocalEmpty()' >> hello-world.cc:(.text+0x407): undefined reference to >> `v8::Value::Uint32Value(v8::Local<v8::Context>) const' >> hello-world.cc:(.text+0x43d): undefined reference to >> `v8::V8::FromJustIsNothing()' >> hello-world.cc:(.text+0x475): undefined reference to `v8::Context::Exit()' >> hello-world.cc:(.text+0x484): undefined reference to >> `v8::HandleScope::~HandleScope()' >> hello-world.cc:(.text+0x49f): undefined reference to >> `v8::Isolate::Dispose()' >> hello-world.cc:(.text+0x4a4): undefined reference to `v8::V8::Dispose()' >> hello-world.cc:(.text+0x4a9): undefined reference to >> `v8::V8::ShutdownPlatform()' >> hello-world.cc:(.text+0x4e6): undefined reference to >> `v8::Isolate::CreateParams::~CreateParams()' >> hello-world.cc:(.text+0x52b): undefined reference to >> `v8::String::Utf8Value::~Utf8Value()' >> hello-world.cc:(.text+0x54a): undefined reference to `v8::Context::Exit()' >> hello-world.cc:(.text+0x55e): undefined reference to >> `v8::HandleScope::~HandleScope()' >> hello-world.cc:(.text+0x586): undefined reference to >> `v8::Isolate::CreateParams::~CreateParams()' >> /tmp/ccIoFwWc.o: In function `v8::Isolate::Scope::Scope(v8::Isolate*)': >> hello-world.cc:(.text._ZN2v87Isolate5ScopeC2EPS0_[_ZN2v87Isolate5ScopeC5EPS0_]+0x23): >> >> undefined reference to `v8::Isolate::Enter()' >> /tmp/ccIoFwWc.o: In function `v8::Isolate::Scope::~Scope()': >> hello-world.cc:(.text._ZN2v87Isolate5ScopeD2Ev[_ZN2v87Isolate5ScopeD5Ev]+0x17): >> >> undefined reference to `v8::Isolate::Exit()' >> /tmp/ccIoFwWc.o: In function `v8::Local<v8::String> >> v8::String::NewFromUtf8Literal<21>(v8::Isolate*, char const (&) [21], >> v8::NewStringType)': >> hello-world.cc:(.text._ZN2v86String18NewFromUtf8LiteralILi21EEENS_5LocalIS0_EEPNS_7IsolateERAT__KcNS_13NewStringTypeE[_ZN2v86String18NewFromUtf8LiteralILi21EEENS_5LocalIS0_EEPNS_7IsolateERAT__KcNS_13NewStringTypeE]+0x27): >> >> undefined reference to `v8::String::NewFromUtf8Literal(v8::Isolate*, char >> const*, v8::NewStringType, int)' >> /tmp/ccIoFwWc.o: In function `v8::Local<v8::String> >> v8::String::NewFromUtf8Literal<487>(v8::Isolate*, char const (&) [487], >> v8::NewStringType)': >> hello-world.cc:(.text._ZN2v86String18NewFromUtf8LiteralILi487EEENS_5LocalIS0_EEPNS_7IsolateERAT__KcNS_13NewStringTypeE[_ZN2v86String18NewFromUtf8LiteralILi487EEENS_5LocalIS0_EEPNS_7IsolateERAT__KcNS_13NewStringTypeE]+0x27): >> >> undefined reference to `v8::String::NewFromUtf8Literal(v8::Isolate*, char >> const*, v8::NewStringType, int)' >> collect2: error: ld returned 1 exit status >> >> What can I do about that? :( >> Thanks. >> >> 在2020年12月15日星期二 UTC+8 下午12:35:30<Ricky Du> 写道: >> >>> Thank you, I am using c++0x, >>> I haven't noticed that. >>> :) >>> >>> 在2020年12月15日星期二 UTC+8 上午7:03:33<seth.b...@microsoft.com> 写道: >>> >>>> How are you attempting to build? I see on >>>> https://en.cppreference.com/w/cpp/types/remove_cv that remove_cv_t was >>>> introduced in C++ 14; are you using an older compiler? >>>> >>>> >>>> ------------------------------ >>>> *From:* v8-...@googlegroups.com <v8-...@googlegroups.com> on behalf of >>>> Ricky Du <dwtfro...@gmail.com> >>>> *Sent:* Monday, December 14, 2020 11:37 AM >>>> *To:* v8-...@googlegroups.com <v8-...@googlegroups.com> >>>> *Subject:* [EXTERNAL] [v8-dev] Complie sample error >>>> >>>> In file included from ./include/v8.h:30:0, >>>> from samples/process.cc:28: >>>> ./include/v8-internal.h: In function ‘void >>>> v8::internal::PerformCastCheck(T*)’: >>>> ./include/v8-internal.h:452:33: error: ‘remove_cv_t’ is not a member of >>>> ‘std’ >>>> !std::is_same<Data, >>>> std::remove_cv_t<T>>::value>::Perform(data); >>>> ^ >>>> ./include/v8-internal.h:452:33: error: ‘remove_cv_t’ is not a member of >>>> ‘std’ >>>> ./include/v8-internal.h:452:50: error: template argument 2 is invalid >>>> !std::is_same<Data, >>>> std::remove_cv_t<T>>::value>::Perform(data); >>>> ^ >>>> ./include/v8-internal.h:452:61: error: ‘::Perform’ has not been declared >>>> !std::is_same<Data, >>>> std::remove_cv_t<T>>::value>::Perform(data); >>>> >>>> I don't know what's the problem, thank you so much! >>>> >>>> -- >>>> -- >>>> v8-dev mailing list >>>> v8-...@googlegroups.com >>>> http://groups.google.com/group/v8-dev >>>> <https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fv8-dev&data=04%7C01%7Cseth.brenith%40microsoft.com%7C3fcc155d64224cf1d9d008d8a067a8f2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637435714505996491%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=62CU8YhdWZWLbuvi52wjNcJy87ms3afTN430yPwGnL8%3D&reserved=0> >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "v8-dev" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to v8-dev+un...@googlegroups.com. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/v8-dev/CAPZXk3gaLTB8E%3DBE3QD-DHoQG5BOK7n9ViWVCk%3D05f3dC7mKhQ%40mail.gmail.com >>>> >>>> <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fv8-dev%2FCAPZXk3gaLTB8E%253DBE3QD-DHoQG5BOK7n9ViWVCk%253D05f3dC7mKhQ%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Cseth.brenith%40microsoft.com%7C3fcc155d64224cf1d9d008d8a067a8f2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637435714505996491%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=xYswU5xwg%2Bo%2FeiQxKg1jN2jOpqbcql8jbFpHFK2mFko%3D&reserved=0> >>>> . >>>> >>> -- >> -- >> v8-dev mailing list >> v8-...@googlegroups.com >> http://groups.google.com/group/v8-dev >> --- >> You received this message because you are subscribed to the Google Groups >> "v8-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to v8-dev+un...@googlegroups.com. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/v8-dev/98f4851a-3d60-4562-99e3-4ac621bc7b08n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/v8-dev/98f4851a-3d60-4562-99e3-4ac621bc7b08n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > Best, > Zhi An > -- -- v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/c543e825-28a0-48a2-b86a-a5295248ea89n%40googlegroups.com.