Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode4 workspace sharing projects

I am trying to use the new Xcode4 workspace feature to migrate some Xcode3 projects that has dependencies between them. I have a project which creates a static library and then an application project which depends on the static library. So, as the guide mentioned, I created a new workspace and dragged both the projects into the workspace. However, when I build my application, it's unable to find the header files from my static library. I get "No such file or directory" error. My intention is to let Xcode auto detect the dependencies. But, not sure what I am doing wrong, I couldn't get it to work. Any help is greatly appreciated. There isn't much documentation out there either.

like image 456
user320587 Avatar asked Nov 17 '25 05:11

user320587


1 Answers

After few frustrating hours, I may have found a solution (still not sure if it's the right way).

  1. Created a new workspace
  2. Added the shared library project
  3. Added the application project below shared library (not inside)
  4. Open Build Phase of shared library and made sure when copying headers it is grouped to public
  5. Open Build settings of application and in the Header Search Paths typed in "BUILD_PRODUCTS_DIR"\usr\local\include
  6. And in Build Phase of target, included a link to static library (shared library)

Did a clean and build and everything was built successfully.

However, I am still not convinced this is the right way, as according to Xcode4 guide, no changes to settings is necessary, just adding projects to workspace will take care of everything. Someday, I hope to find the correct solution and use it.

Thanks Javid

like image 93
user320587 Avatar answered Nov 18 '25 21:11

user320587



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!