David
David

Reputation: 14404

Linking error in Xcode 4

I know this is a long shot but, I've been having trouble with a linker error that I specifically don't understand. Please refer to the picture below.

enter image description here

The project contains 4 targets. This error points specifically to one target that is a BSD/Shell helper tool written in c.

I'm sorry for being vague, as I don't fully understand what might be the problem. Any suggestions? Thank you.

Upvotes: 3

Views: 254

Answers (2)

user557219
user557219

Reputation:

Usually, this means that the source file that defines main() hasn’t been added to the corresponding target.

Another possible reason is that the source file that contains main() is being compiled for an architecture (e.g. i386 only) but the target/executable specifies a different architecture (e.g. x86_64 only or fat/universal).

One strategy to help with diagnosing this issue is running xcodebuild against your project+target to inspect the commands that are being issued to compile and link the target.

When all else fails, remove the target and add it again.

Upvotes: 2

Alexsander Akers
Alexsander Akers

Reputation: 16024

Did you #include the appropriate files?

Upvotes: 0

Related Questions