Alexandre Ouicher
Alexandre Ouicher

Reputation: 856

How to see invocation in Xcode

I'have got an error in build. Xcode return

Undefined symbols for architecture i386:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Do you know how can i launch build with -v to see invocation ?

Upvotes: 6

Views: 5427

Answers (2)

GoZoner
GoZoner

Reputation: 70135

In Xcode click on 'View', 'Navigators' and 'Show Report Navigator' then click on the build that failed. In the listing of the build steps you will see your 'use -v to see invocation' - to the right click on the disclosure icon (next to the error icon).

Screenshot indicating where to clickDoing that will show the details of the linker invocation.

Of course, the actual problem is that you are building an executable without including the file that contains 'main'. Usually one is created for you and automatically included - based on the target. If you are making a target yourself; you'll need main() implemented somewhere.

Upvotes: 5

jack
jack

Reputation: 21

You can add the -v to the "Other Linker Flags" field in the project settings. Doing so in a test project here yields the complete linker invocation:

complete linker invocation

complete linker invocation

when you add -v to "Other Linker Flags" you will get more information, this is the different between add before and add behind

Upvotes: 2

Related Questions