# Introjucer and relative paths in XCode

**URL:** <https://forum.juce.com/t/introjucer-and-relative-paths-in-xcode/8155>\
**Category:** General JUCE discussion\
**Created:** [February 19, 2012, 1:18pm UTC](https://forum.juce.com/t/introjucer-and-relative-paths-in-xcode/8155 "2012-02-19T13:18:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yairadix](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yairadix/32/1114_2.png) [@yairadix](https://forum.juce.com/u/yairadix)\
**Post date:** [February 19, 2012, 1:18pm UTC](https://forum.juce.com/t/introjucer-and-relative-paths-in-xcode/8155/1 "2012-02-19T13:18:27Z")

</div>

I’m trying to use the Introjucer and the generated project has failed linking.

It failed as it was searching for “libPluginLibrary” at “$(SRCROOT)/…/…/PT\_80\_SDK/MacBag/Libs/Release”,  
but it didn’t know what SRCROOT was. (so it looked for it at Builds/MacOSX/…/…/PT\_80\_SDK etc)

Adding

```auto
s.add("SRCROOT = \"../..\"");
```

at XCodeProjectExporter::getTargetSettings  
solves the problem.

This report is based on juce version from git with last commit from 2012.02.17 - b66a82aa441ddd80f61d5b8049d6e3a35ebddb1b

btw, is this the proper way to report bugs etc or is there a different preferred way?

cheers  
-Yair

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 20, 2012, 11:12am UTC](https://forum.juce.com/t/introjucer-and-relative-paths-in-xcode/8155/2 "2012-02-20T11:12:12Z")

</div>

Thanks, I’ll add something to handle that!

And yes, the forum’s the place for bugs and requests. I’ve never been a fan of formal bug-tracking software, (though I’m sure bug-trackers are a lot nicer to use than the last time I used one, many years ago!)

---

<div class="post-metadata">

**Author:** ![bdejong](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bdejong/32/288_2.png) [@bdejong](https://forum.juce.com/u/bdejong)\
**Post date:** [June 27, 2012, 8:09am UTC](https://forum.juce.com/t/introjucer-and-relative-paths-in-xcode/8155/3 "2012-06-27T08:09:08Z")

</div>

Guys,

I don’t know if this has changed in the latest versions of xcode, but this is definitely NOT right:  
If you do not define SRCROOT it is defined per default by XCode to point to the ABSOLUTE path of the folder containing the project files.

Defining it as a relative path is a very bad idea:  
Depending on the build settings your products or DerivedData can be in a completely different place. The only way to get some kind of “absolute” reference in your fifle system is by using SRCROOT, all the rest is relative defined to that one.

I opened an introjucer project in xcode (4.3), deleted the SRCROOT define that the introjucer created and now SRCROOT (as if by magic) refers again to the absolute path of the project file.

s.add(“SRCROOT = “…/…””); --\> Could this line please be removed again from the introjucer?

- Bram

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [June 27, 2012, 10:27am UTC](https://forum.juce.com/t/introjucer-and-relative-paths-in-xcode/8155/4 "2012-06-27T10:27:58Z")

</div>

Hmm… I don’t think I’d have added that if it wasn’t needed… Perhaps it’s something that Xcode 3 didn’t do. But thanks, I’ll take a look at that.

---

<div class="post-metadata">

**Author:** ![bdejong](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bdejong/32/288_2.png) [@bdejong](https://forum.juce.com/u/bdejong)\
**Post date:** [June 27, 2012, 12:22pm UTC](https://forum.juce.com/t/introjucer-and-relative-paths-in-xcode/8155/5 "2012-06-27T12:22:25Z")

</div>

Thanks… Most of my problems can ALSO be solved by a post-build script that copies libraries to where they need to be in the app bundle, so _that_ would be fine too…

- bram
