Complie sample error

165 views
Skip to first unread message

Ricky Du

unread,
Dec 14, 2020, 2:37:14 PM12/14/20
to v8-...@googlegroups.com
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!

Seth Brenith

unread,
Dec 14, 2020, 6:03:33 PM12/14/20
to v8-...@googlegroups.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
 
--
--
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/CAPZXk3gaLTB8E%3DBE3QD-DHoQG5BOK7n9ViWVCk%3D05f3dC7mKhQ%40mail.gmail.com.

Ricky Du

unread,
Dec 14, 2020, 11:35:30 PM12/14/20
to v8-dev
Thank you, I am using c++0x,
I haven't noticed that.
:)

Ricky Du

unread,
Dec 15, 2020, 4:18:56 AM12/15/20
to v8-dev
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

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.

Zhi An Ng

unread,
Dec 15, 2020, 5:13:07 AM12/15/20
to v8-...@googlegroups.com
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.
 

Ricky Du

unread,
Dec 16, 2020, 6:27:28 PM12/16/20
to v8-dev
Hi, I solved this problem under your guys help,
Thank you so much!

Reply all
Reply to author
Forward
0 new messages