On Tuesday, April 10, 2012 6:22:13 PM UTC-7, Luke wrote: > > When linking V8 to my project what static libraries do I need to link? > After building with GYP I have the following: > > libpreparser_lib.a > libv8_base.a > libv8_nosnapshot.a > libv8_snapshot.a > > Which do I need to link against? Which should be left out? >
I still need an answer on this. > I'm also having trouble linking against libv8.dylib. After building it > (with module=shared option) it ends up in /v8/out/x64.release/ > libv8.dylib. > > I want it in /phpdev/lib. But when I try to link against it there, > what I build references /v8/out/x64.release/libv8.dylib not /phpdev/ > lib/libv8.dylib. > > Building the second script in getting started: > https://developers.google.com/v8/get_started > > $ ./hello_world > > dyld: Library not loaded: /v8/out/x64.release/libv8.dylib > Referenced from: /test/./hello_world > Reason: image not found > Trace/BPT trap > > $ otool -L ./hello_world > ./hello_world: > /v8/out/x64.release/libv8.dylib (compatibility version 0.0.0, > current > version 0.0.0) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current > version 125.2.11) > /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current > version 7.9.0) > Figured this part out. Need to run: $ cd /phpdev/lib $ install_name_tool -id /phpdev/lib/libv8.dylib libv8.dylib After recompiling it should pick up the library in the right location. You can fix existing binaries like this: $ install_name_tool -change /v8/out/x64.release/libv8.dylib /phpdev/lib/libv8.dylib hello_world I'm not sure why the dylib's id is an absolute path. Perhaps this is a bug in the compilation process? Luke -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
