Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using $(BUILT_PRODUCTS_DIR) in User Header Search Path

When I use $(BUILT_PRODUCTS_DIR) in User Header Search Path (as recommended in this tutorial about static libraries) XCode 4 resolves it like this:

enter image description here

This is a problem while I work with the simulator, because the build files are stored in Debug-iphonesimulator instead of Debug-iphoneos, and XCode fails to find headers.

My current workaround is build first for iOS Device, and then work with the Simulator. This is a bit tedious and error-prone. What am I doing wrong?

like image 367
hpique Avatar asked Aug 24 '11 17:08

hpique


2 Answers

The build products directory should be used for output by Xcode, and it is perfectly reasonable for these directories to be nonexistent at the time you begin to build. It is not advisable to have dependencies like user headers in these directories.

My recommendation would be to move the dependent headers out of the directory you're talking about.

like image 150
fbrereto Avatar answered Sep 23 '22 17:09

fbrereto


I had the same problem. I fixed it by doing the following. Instead of setting the User Header Search Paths to $(BUILT_PRODUCTS_DIR) recursive, I set it explicitly to $(BUILT_PRODUCTS_DIR)/usr/local/include non-recursive.

like image 39
erykW Avatar answered Sep 23 '22 17:09

erykW