Re: Linker error with std C tool
Re: Linker error with std C tool
- Subject: Re: Linker error with std C tool
- From: Jeremy Pereira <email@hidden>
- Date: Wed, 14 Oct 2009 11:46:31 +0100
On 13 Oct 2009, at 16:21, McLaughlin, Michael P. wrote:
I created myFile.c file and its header, place them in a subdirectory
of the
project directory and added that directory to the project (drag-and-
drop).
main.c and myFile.c are both checked in the source list. main.c
includes
myFile.h and calls a function myFunc() in myFile.c. myFunc shows up
as a
project symbol.
The project compiles but I get a linker error:
_myFunc
symbol not found
When I check Build Results, it shows only main.o being built even
though,
when I select the target, myFile shows up in the list of sources for
the
tool.
If I add
#include "myFunc.c"
to main.c, there is no linker error.
I am completely bewildered. Clearly, I'm missing something basic.
Could
someone please tell me what it is?
Check the target. The target for your project should have a "compile
sources" phase. I'd bet money on the only source file in that phase
being main.c. Drag myFunc.c into the compile sources phase and it
should all start working.
Thanks in advance.
--
Mike McLaughlin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden