Accessing file between two projects in Xcode workspace?

I am having 2 projects(ProjectA & ProjectB) in workspace. I need to access a file from ProjectA into ProjectB.
Ex:- I have a file named Test.h & Test.m in project A. I am using it in project B. I had given the header path of Test.h file in Target of Project B.

Now I am getting error as " Undefined symbols for architecture i386: "_OBJC_CLASS_$_Test2", referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)"

I want to use it as a separate projects instead of library.

To use a file from one project in another project you drag the file (from wherever it is in that first project) in a Finder window to the list of files on the left of the new Xcode project and you chose to make a copy of the file in the new Xcode project.

Thank you.
But I dont want the same file be in two projects. Is there any build seetings that I can point to other project or file & get its .o file into Project A build pointing location

Build settings

Search paths

Always search user path - (YES)

User Header Search Paths - (set it to the file path that will be shown when you select the file and look on the right window in Xcode)


OR


General

Linked Frameworks and Libraries

add the .a file (maybe also a .o file)

Accessing file between two projects in Xcode workspace?
 
 
Q