danbev / learning-v8

Project for learning V8 internals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build test unit finish, how run it errors

zhangwinning opened this issue · comments

Hi @danbev I execute make test/object_test, show below it, it's no problem, generate object_test executable file.

➜  learning-v8 git:(master) ✗ make test/object_test
g++ -Wall -g -O0 test/main.cc test/object_test.cc -o test/object_test  /Users/videojj/study/googletest/install/lib/libgtest.a -std=c++14 -fno-exceptions -fno-rtti -Wcast-function-type -Wno-unused-variable -Wno-class-memaccess -Wno-comment -Wno-unused-but-set-variable -DV8_COMPRESS_POINTERS -DV8_INTL_SUPPORT -I/Volumes/liyao/v8/include -I/Volumes/liyao/v8 -I/Volumes/liyao/v8/third_party/icu/source/common/ -I/Volumes/liyao/v8/out/x64.release_gcc/gen -L/Volumes/liyao/v8/out/x64.release_gcc -I./Volumes/liyao/googletest/googletest/include -lv8 -lv8_libplatform -lv8_libbase -Wl,-L/Volumes/liyao/v8/out/x64.release_gcc -Wl,-L/usr/lib64 -Wl,-lstdc++ -Wl,-lpthread
warning: unknown warning option '-Wcast-function-type'; did you mean '-Wbad-function-cast'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-class-memaccess'; did you mean '-Wno-class-varargs'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
      [-Wunknown-warning-option]
3 warnings generated.
warning: unknown warning option '-Wcast-function-type'; did you mean '-Wbad-function-cast'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-class-memaccess'; did you mean '-Wno-class-varargs'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
      [-Wunknown-warning-option]
3 warnings generated.
ld: warning: directory not found for option '-L/usr/lib64'

however when I execute ./test/object_test, errors below it,I don't know to solve it, please help me

dyld: Library not loaded: @rpath/libv8.dylib
  Referenced from: /Users/videojj/study/learning-v8/./test/object_test
  Reason: image not found
[1]    77150 abort      ./test/object_test

@zhangwinning Can you fetch/pull and try this again? I've removed /usr/lib64 and also added rpath.

@danbev I have pull code just now, however when build show errors.

➜  learning-v8 git:(master) ✗ make test/object_test
g++ -Wall -g -O0 test/main.cc test/object_test.cc -o test/object_test  /Users/videojj/study/googletest/install/lib/libgtest.a -std=c++14 -fno-exceptions -fno-rtti -Wcast-function-type -Wno-unused-variable -Wno-class-memaccess -Wno-comment -Wno-unused-but-set-variable -DV8_COMPRESS_POINTERS -DV8_INTL_SUPPORT -I/Volumes/liyao/v8/include -I/Volumes/liyao/v8 -I/Volumes/liyao/v8/third_party/icu/source/common/ -I/Volumes/liyao/v8/out/x64.release_gcc/gen -L/Volumes/liyao/v8/out/x64.release_gcc -I./deps/googletest/googletest/include -lv8 -lv8_libplatform -lv8_libbase -Wl,-L/Volumes/liyao/v8/out/x64.release_gcc -Wl,-rpath=/Volumes/liyao/v8/out/x64.release_gcc -Wl,-lstdc++ -Wl,-lpthread
warning: unknown warning option '-Wcast-function-type'; did you mean '-Wbad-function-cast'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-class-memaccess'; did you mean '-Wno-class-varargs'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
      [-Wunknown-warning-option]
3 warnings generated.
warning: unknown warning option '-Wcast-function-type'; did you mean '-Wbad-function-cast'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-class-memaccess'; did you mean '-Wno-class-varargs'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
      [-Wunknown-warning-option]
3 warnings generated.
ld: unknown option: -rpath=/Volumes/liyao/v8/out/x64.release_gcc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [test/object_test] Error 1

@danbev thanks, I test unit on my mac just now, it's no problem, The following I can be leaning v8 api