user138388
user138388

Reputation: 11

Objective-C Linker Issue in Xcode When Using API

First, I was receiving errors when having added the IQ Engines' VisionIQ ios-sdk source code to my project path, so I turned Objective-C Automatic Reference Counting to "No" per an online Objective-C/iOS forum. That removed those errors.

After that I started receiving an error for my "Linker command failed with exit code 1", as well as a warning regarding my linker. See below for the full verbiage.

 ld: warning: ignoring file /Users/steve_markey_99/Desktop/iqengines/IQEnginesSDK/Local/libIQEnginesLocal.a, missing required architecture i386 in file

ld: duplicate symbol _main in /Users/steve_markey_99/Library/Developer/Xcode/DerivedData/Appnosis5-aavlzfkfrroooycvukmcvhdhccik/Build/Intermediates/Appnosis5.build/Debug-iphonesimulator/Appnosis5.build/Objects-normal/i386/main-5EBE64A76029E73E.o and /Users/steve_markey_99/Library/Developer/Xcode/DerivedData/Appnosis5-aavlzfkfrroooycvukmcvhdhccik/Build/Intermediates/Appnosis5.build/Debug-iphonesimulator/Appnosis5.build/Objects-normal/i386/main-FE71900E2479E387.o for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Here is my system info:

Apple LLVM compiler 3.1 (when changed to LLVM GCC 4.2 I get more errors)

Xcode 4.3.3

MacBook OS X 10.7.4

IQ Engines VisionIQ ios-sdk (downloaded on July 5, 2012)

iOS SDK 5.1

Link-Time Optimization = "No"

There is a suggestion that I go to: "build settings for static libraries included in the project, making sure that stripping of the linked product (the .a file) is either disabled or set to strip debug symbols only."

I don't see the argument/parameter to change here? Is this an accurate solution? If so, how do I do this?

FYI, I have reached out to the IQ Engines support folks. Looking for a second opinion here while I wait.

P.S. I haven't seen any documentation from IQ Engines saying that the API does not run on an i386 chip set. Though, my spidey er common sense says that that is the problem… Thoughts?

Muchas gracias!

Steve-o

Upvotes: 0

Views: 329

Answers (2)

Karoly S
Karoly S

Reputation: 3268

A lot of times when you get an i386 linker error its because you didn't include, or incorrectly included the necessary frameworks/libraries. I have zero experience with VisionIQ and the required libraries so aside from trying to interpret the error message I cannot help too much. You should try to start a fresh project and see if you can re-include their library and then build the project.

Also the second error that you get regarding the duplicate main symbols is something worth looking into, as mentioned by Martin and Dustin.

Upvotes: 0

Martin Brugger
Martin Brugger

Reputation: 3158

ld: duplicate symbol _main

Are you sure you did not include another source file containing

int main(int argc, char** argv)

?

Upvotes: 1

Related Questions