Macでv8をリンクしようとするときのエラー

v8をビルドして,生成されたライブラリをリンクしようとしたところ
以下のようにエラーが出た.

Yasuharu-Shibata-no-MacBook-Pro.local:~/development/c++/v8:{2448}> g++ -I./v8/include sample2.cpp -o sample2 ./v8/libv8.a -lpthread
ld: warning: in ./v8/libv8.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols:
"v8::FunctionTemplate::PrototypeTemplate()", referenced from:
_main in cca7KzMd.o
"v8::Context::Enter()", referenced from:
v8::Context::Scope::Scope(v8::Handle<v8::Context>)in cca7KzMd.o
"v8::String::New(char const*, int)", referenced from:
_main in cca7KzMd.o

sconsでv8をビルドしたときに何もオプションを指定してなかったんだけど,
アーキテクチャを指定しないといけないとのこと.
v8をビルドするときに以下のようにする.

scons arch=x64

うん,問題なく動いた.v8すごく使いやすい...

Posted at : 2011-11-10 17:47:06 / Category : none

Comments

まだコメントはありません / No comment.

Send comment


Name


Mail-address (empty is OK. If you want to notify update, please fill mail-address.)


Bot check code (240419 と入力してください / Please input 240419.)