Problems using a framework that I have created
I'm trying to create a framework to u开发者_JAVA百科se in some of my projects. Here's what I did so far:
- Created a framework project;
- Added a class (myFw) to the framework and set the header to public;
- Built the framework;
- Copied the framework from the built folder to a "visible location";
- Added the framework to one of my projects;
- Added the path to the framework's Headers to the 'User Header Search Paths'.
When I build my project I get:
Undefined symbols for architecture x86_64:
"myFw::myFw()", referenced from:
Playground::Playground() in Playground.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What am I doing wrong to get this linking error? Is the problem in the framework or in the project using the framework?
Another thing: Without Step 6, Xcode's autocomplete helps me type the #include for my class and use it in the code, but when I compile it fails to find the header file... I managed to fix this with Step 6 but assume there's a better way for doing this, right?
(I'm using Xcode 4.1 in Lion)
Thanks in advance!
精彩评论