# Why is my library linking to the wrong path?

- Thread: https://externals.io/message/59676
- Original archive: https://news-web.php.net/php.internals/59676
- Started by Luke Scott on 2012-04-10T21:55:12+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #59676 — Luke Scott — 2012-04-10T21:55:12+00:00

URL: https://externals.io/message/59676#59676

I'm using the line:

PHP_ADD_LIBRARY_WITH_PATH(v8, $V8_DIR/$PHP_LIBDIR, V8PHP_SHARED_LIBADD)

Where the path is /phpdev/lib. But my extension is actually linking to
/v8/out/x64.release/libv8.dylib instead of /phpdev/lib/libv8.dylib even
though /v8/out/x64.release no longer exists.

What am I doing wrong?

Luke

---

## #59764 — Luke Scott — 2012-04-11T23:29:58+00:00

URL: https://externals.io/message/59676#59764 · In reply to: #59676

> I'm using the line:
> 
> PHP_ADD_LIBRARY_WITH_PATH(v8, $V8_DIR/$PHP_LIBDIR, V8PHP_SHARED_LIBADD)
> 
> Where the path is /phpdev/lib. But my extension is actually linking to
> /v8/out/x64.release/libv8.dylib instead of /phpdev/lib/libv8.dylib even though
> /v8/out/x64.release no longer exists.
> 
> What am I doing wrong?
> 
> Luke

Was probably super obvious, but install_name_tool is how you fix the issue.
First use the "-id" parameter on the .dylib to fix the dylib. Then recompile
(or fix with -change flag).

Luke
