Upgrading OSX/Xcode – linking failure

xcode

ALL,

I started my project on OSX 10.8 with the Xcode 5.1 (latest available for that OSX). Everything was building and running fine and it still is. The project consist of a binary executable and couple of dylib sub-projects.

Recently I bought myself a new Mac laptop. I installed Xcode on it (version 9), pull my sources from git hub and tried to re-compile/run it.

After fixing some minor directories issuers for compilation (some header search path were wrong), I received a warning about -L directory not found. However linking succeeded.

Trying to run the program obviously failed because the dylib files were not at the place were Xcode would look for it.

Looking further I tried to see if there would be any differences on where both machines store the build results. I opened the "Xcode->Project Properties…" menu, but turns out that those settings are the same on both laptops.

Next I checked the "Fie->Project Properties…" on both machines, but those 2 are also turns out to be the same.

Now I'm at the loss – where else should I look? The old laptop build everything without warnings and the program executes successfully.

On the old laptop the subprojects are stored inside ~///build/Debug.

On the new laptop the folder ~///build does not exist.

Now I can create the directory manually and copy over the files, but the program is still under development and the code is changing.

Any pointers would be appreciated.

TIA!

P.S.: Sorry for the long post.

Best Answer

Solving in somewhat unusual way:

a) You claim "However linking succeeded.", so in project properties pane, go to Products folder, then click on product name. On the right-side pane, under Identity and Type, you will find out the name of the product and the full path location. For one of my projects now i can find out:

~/Library/Developer/Xcode/DerivedData/prodname fnihcmsxnrxlstcumyviklyuofum/Build/Products/Debug/prodname

and a location attribute: Relative to Build Products - build folder was create by Xcode, you can find out "Build" also in Project Properties -> Build Settings -> Build Locations. (you can modify also according to your needs...)

b) Now for your missing library: also in Build Settings -> Linking you have the possibility to add your library at Prelink libraries, just click at the left of this item, two lines open below, Debug/Release, click on one line and a small + appears and add your library there.

EDIT: adding some pictures, as requested:

Selecting the Product:

enter image description here

Click on product name (rectangle on the picture) and the full path is to be found on the right pane as in this picture:

enter image description here

Now, in the first picture: click on application name icon, will open building info. Building path(s) are to be found as shown here:

enter image description here

And scrolling down further, the linking options as revealed here:

enter image description here