0

Sorry about english mistakes) Please help. I try build v8 engine from "Hellow world" example. It will be embedded on my base project, so i am need build it with Cmake, (system is macOS Sierra). I compiled v8 engine (build libraries by default stored in out directory) and i have following file system structure:

screen file system

As showed in example it later most build with this make expression :

g++ -I. hello_world.cpp -o hello_world -Wl,--start-group out/x64.release/obj.target/{tools/gyp/libv8_{base,libbase,external_snapshot,libplatform},third_party/icu/libicu{uc,i18n,data}}.a -Wl,--end-group -lrt -ldl -pthread -std=c++0x

also, please look at my CMakeLists.txt file:

screen CMakeLists.txt

On build i have the following error output:

ld: symbol(s) not found for architecture x86_64
  • Does homebrew `v8` formula works for you? If you need latest v8 version have a look at my `v8@5.7` formula under [pinepain/devtools](https://github.com/pinepain/homebrew-devtools) tap. It is less likely you want to build it alongside your project as recent versions build libbase and others as dynamic, so it is much simpler now. To build hello world see [hello_world_build_osx.sh](https://github.com/pinepain/php-v8/blob/upgrade-to-v8-5.7/scripts/test_v8/hello_world_build_osx.sh) script I use to test v8 build (note, you may want to specify proper `ROOT` path). – pinepain Dec 08 '16 at 14:11
  • Can you please publish what symbols are missed? – pinepain Dec 08 '16 at 14:13
  • You need to actually provide the error output. Also, do not post images of text, post the text in the question. – xaxxon Dec 09 '16 at 23:03
  • problem is solved, see all page – Вячеслав Бричковский Dec 10 '16 at 00:21

1 Answers1

0

I solved problem, and for future i write my steps, how build V8 on macOS:

  1. Build v8 engine without snapshot and as shared library for native platform: sudo make library=shared snapshot=off native;

  2. Compile with clang (gcc throw error, like "undefined symbol for architecture..." etc ) but clang on mac compiles fine;

  3. Copy from your ./out directory files with *./dylib to usr/local/lib

  • if you get a bunch of errors when linking with other programs, you may need to tell it to compile with libc++ instead of libstdc++. See the env vars I set here: https://github.com/xaxxon/v8toolkit/blob/master/osx_v8_build.md You will also need to copy a couple .a files from that directory, as not everything is built into a shared library. – xaxxon Dec 12 '16 at 05:31