Let's keep the conversation focused on the v8-users thread:
https://groups.google.com/g/v8-users/c/bgcv6AqnrZs.

On Wed, Dec 4, 2024 at 12:40 PM Grant Upson <[email protected]> wrote:

> Hi everyone,
>
> I'm trying to embed V8 into a C++ project currently and keep encountering
> issues when linking V8. Currently i'm following the instructions on
> https://v8.dev/docs/embed and doing this on Linux. After building V8 with
> these parameters
>
> gn gen out.gn/library --args='is_debug=false is_component_build=false
> v8_enable_i18n_support=false is_clang=true v8_monolithic=true
> target_cpu="x64" v8_use_external_startup_data=false'
>
> and attempting to link to the libv8_monolith.a static library it throws a
> bunch of undefined reference errors to the standard library e.g.,
>
> undefined reference to `std::__1::basic_string<char,
> std::__1::char_traits<char>, std::__1::allocator<char>
> >::__init_copy_ctor_external(char const*, unsigned long)'
>
> I've setup my default compiler to use clang with the LLVM standard library
> and using nm have determined that V8 is being built with clang and the LLVM
> std library since it outputs std::__1:: function symbols.
>
> I've also forced libc++ to be used in the cmake project that is trying to
> link to the V8 library with cmake commands like so
>
> set(CMAKE_CXX_STANDARD_LIBRARIES "-stdlib=libc++")
> set(CMAKE_C_FLAGS "-stdlib=libc++")
> set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++
> -lc++abi")
>
> I'm really at a loss at what could be causing this issue. Any advice?
>
>

-- 
-- 
v8-dev mailing list
[email protected]
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/v8-dev/CAKSzg3T%2BChdvV_shcW2TbEJ3oKk4P%2B9RT1G8f3q6ZdYybLebNw%40mail.gmail.com.

Reply via email to