Question

I was making a build script for an iOS project. The project builds through XCode; however, with the xcodebuild command I get a weird linking error:

ld: warning: ignoring file /sw/lib//libiconv.dylib, file was built for x86_64 which is not the architecture being linked (armv7): /sw/lib//libiconv.dylib
Undefined symbols for architecture armv7:
"_iconv_open", referenced from:
  l2451 in libscanditsdk-iphone-3.1.1.a(mirasense.o)
"_iconv", referenced from:
  l2451 in libscanditsdk-iphone-3.1.1.a(mirasense.o)
"_iconv_close", referenced from:
  l2451 in libscanditsdk-iphone-3.1.1.a(mirasense.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Searching Google and SO hasn't revealed a solution.

The libiconv.dylib is listed under the "Linked Binary" er framework thing.

I'm completely stumped on this one. Like the project does compile through XCode itself

Here's the command I'm using to initiate the build:

xcodebuild -target "${TARGET_NAME}" -sdk "${TARGET_SDK}" -configuration Release -scheme "${SCHEME_NAME}" PROVISIONING_PROFILE="${PROJ_PROF_UUID}"
Was it helpful?

Solution

I found that to fix this you have add $(inherited) to the Library Search Path. This should search for the libiconv in iOS SDK and not the dynamic library shared on the computer

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top