简体   繁体   中英

xcode 5 - compiling source without including the files

I am creating a library for Mac using XCode5 which is using some code (c++) that is being developed and maintained by other developer and is at a different path than my library project.

eg my project is at /svntrunk/../../mylibraryproject/

The code I want to compile(use) in my library is at

/svntrunk/../../../utils/networkutils/src/source files here

I have tried following approaches

  1. Refer the source files into my project but don't copy them into my project, that way when the other developer updates his code that is automatically reflected since I am pointing to his location. But in this case the linker fails to find the symbols from networkutils code. Here while adding the file to the project I don't select 'Copy items ..' option
  2. Second approach I took is to select 'Copy items..' option while adding the source files from networkutils to my project. This way the files is copied to my project and the compiler is able to find the symbols. But now if the other developer updates networkutils code I have to manually copy the updated code files which doesn't seem to be right thing to do.

It seems that to move forward I will have to go with option 2. Please let me know if there is a better way to approach this problem.

Thanks Dev

If he's developing using Xcode as well and has a project, you could link to the project, build that as a lib and include it in the build dependencies in your project.

I do this for Cocos2d.

Failing that, I would pursue option 1 and try to figure out why it's not finding the symbols. Are you sure you have the correct headers included? One reason the compiler fails to find symbols is that you're using functions whose headers are not included.

Extra info here:

https://stackoverflow.com/a/17415609/290072

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM