# Linking a .dylib from OSX

**URL:** <https://forum.juce.com/t/linking-a-dylib-from-osx/13635>\
**Category:** General JUCE discussion\
**Created:** [September 27, 2014, 10:54am UTC](https://forum.juce.com/t/linking-a-dylib-from-osx/13635 "2014-09-27T10:54:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_pi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/_pi/32/527_2.png) [@\_pi](https://forum.juce.com/u/_pi)\
**Post date:** [September 27, 2014, 10:54am UTC](https://forum.juce.com/t/linking-a-dylib-from-osx/13635/1 "2014-09-27T10:54:14Z")

</div>

I'm trying to link a .dylib.&nbsp; I have renamed/put it in **/path/to/Demo/libpython3\_3.dylib**

In **IntroJucer -\> Config -\> XCode (MacOSX) -\> "_external libraries to link_"** I add " **python3\_3**"

Now I click **"save project and Open in Xcode"**

if I attempt to build the project, it fails with linker error:

```
ld: library not found for -lpython3_3
```

I can think of several things that might be wrong.

- For a start, do I need to add this file into **IntroJucer -\> Files**?
- Maybe I need to supply a path in **IntroJucer -\> Config -\> XCode (MacOSX) -\> Debug -\> "_extra library search paths_"**
- Maybe I can't use dynamic libraries, and I have to use the corresponding static library (.a) -- but wouldn't that be rather ugly and result in bloating the final binary?

What is the right way to do this?

π

---

<div class="post-metadata">

**Author:** ![\_pi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/_pi/32/527_2.png) [@\_pi](https://forum.juce.com/u/_pi)\
**Post date:** [September 27, 2014, 2:19pm UTC](https://forum.juce.com/t/linking-a-dylib-from-osx/13635/2 "2014-09-27T14:19:04Z")

</div>

I've got it working setting:

IntroJucer -\> Config -\> XCode (MacOSX) -\> "external libraries to link":  
**&nbsp;&nbsp;&nbsp; python3\_3**

IntroJucer -\> Config -\> XCode (MacOSX) -\> Debug -\> "extra library search paths":  
&nbsp;&nbsp;&nbsp; **/Users/pi/Dev/JUCE/JUCE-master/extras/Demo/python3\_3**

The actual library is: **/Users/pi/Dev/JUCE/JUCE-master/extras/Demo/libpython3\_3.dylib**

* * *

Even better, now I have created a&nbsp; **/Libs** folder, and moved the library into it):  
&nbsp;&nbsp;&nbsp; **/Users/pi/Dev/JUCE/JUCE-master/extras/Demo/Libs/libpython3.3\_OSX.dylib**

(I also renamed it, remembering that I will have to provide libraries for Linux/Android/Win/iOS in due course)

And I can set a relative path in "extra library search paths"  
&nbsp;&nbsp;&nbsp; **../../Libs**

This feels like the right structure.

(Thanks bazrush)
