I got linkage error when I use a symbol in a static library.
Can anyone tell me how to do the following:
- foo.h:
- foo.cpp:
- produce libfoo.a from foo.cpp
and then:
- Create an empty iPhone project in XCode
- add the directory of foo.h to the 'Header Search Paths'
- add the directory of libfoo.a to the 'Library Search Paths'
- add the library to the project (-lfoo)
- include foo.h in main.m
- call foo() in main.m
I get 'undefined symbol _foo'.
Did anyone achieved this?
Can anyone tell me how to do the following:
- foo.h:
Code:
int foo();
- foo.cpp:
Code:
int foo() {
return 1;
}
and then:
- Create an empty iPhone project in XCode
- add the directory of foo.h to the 'Header Search Paths'
- add the directory of libfoo.a to the 'Library Search Paths'
- add the library to the project (-lfoo)
- include foo.h in main.m
- call foo() in main.m
I get 'undefined symbol _foo'.
Did anyone achieved this?