Error linking V8 on Debian: undefined reference to `v8::base::SysInfo::NumberOfProcessors()'

316 views
Skip to first unread message

Jack

unread,
Aug 11, 2016, 8:12:17 PM8/11/16
to v8-users
When I try compiling my program on Debian using CMake I'm getting the following the error:

/home/jack/v8/out/native/obj.target/v8_libplatform/src/libplatform/default-platform.o: In function `v8::platform::CreateDefaultPlatform(int)':
../src/libplatform/default-platform.cc:(.text._ZN2v88platform21CreateDefaultPlatformEi+0xb5): undefined reference to `v8::base::SysInfo::NumberOfProcessors()'
/home/jack/v8/out/native/obj.target/v8_libplatform/src/libplatform/default-platform.o: In function `v8::platform::DefaultPlatform::SetThreadPoolSize(int)':
../src/libplatform/default-platform.cc:(.text._ZN2v88platform15DefaultPlatform17SetThreadPoolSizeEi+0x1a): undefined reference to `v8::base::SysInfo::NumberOfProcessors()'


Have I built v8 wrong? My CMakeLists file is like this for V8:
link_directories(
  ~/v8/out/native/obj.target/src
  ~/v8/out/native/obj.target/third_party/icu
)
...

target_link_libraries(Main PUBLIC
  v8_base
  v8_libbase
  v8_external_snapshot
  v8_libplatform
  v8_libsampler
  icui18n
  icuuc
  rt
  dl
  pthread
)


~/v8/out/native/obj.target/src includes the following:
libv8_base.a  libv8_external_snapshot.a  libv8_libbase.a  libv8_libplatform.a  libv8_libsampler.a  libv8_nosnapshot.a
and
~/v8/out/native/obj.target/third_party/icu contains:
libicui18n.a  libicuuc.a

Jack

unread,
Aug 13, 2016, 12:32:22 PM8/13/16
to v8-users
I rebuilt it using gn. I used gn args to uncomment is_component_build and this sucessfully generated libv8.so on build. I then linked that and the libv8_libplatform.a that was generated earlier like so:
target_link_libraries(Main PUBLIC
  v8
  v8_libplatform

  icui18n
  icuuc
  rt
  dl
  pthread
)

That links fine.
Reply all
Reply to author
Forward
0 new messages