iosobjective-ciphoneaudio-fingerprintingechoprint

Linker error for echoprint in iOS


I'm using echoprint API for song search from last 3 months. But suddenly it started giving me below errors. Already I have face many problems while adding that API to my project & now it start giving me linker error. It was working for me previously. Error like this:

"Codegen::Codegen(float const*, unsigned int, int)", referenced from: _GetPCMFromFile in File.o

clang: error: linker command failed with exit code 1 (use -v to see invocation)

ld: symbol(s) not found for architecture i386

ld: warning: directory not found for option '-L-L/Users/prajaktakulkarni/Downloads/echoprint-codegen-4.12 2/src/echoprint-codegen-ios/build/Release-iphoneos' ld: warning: ignoring file /Users/prajaktakulkarni/Documents/Instajam/libechoprint-codegen-ios.a, missing required architecture i386 in file /Users/prajaktakulkarni/Documents/Instajam/libechoprint-codegen-ios.a (2 slices) Undefined symbols for architecture i386: "Codegen::Codegen(float const*, unsigned int, int)", referenced from: _GetPCMFromFile in File.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)


Solution

  • The error message is saying that the static library libechoprint-codegen-ios.a hasn't been built for the i386 architecture - which is the architecture used by the simulator.

    You can find out which architectures the static library has been built for by running the following code in Terminal:

    lipo -info ~/Documents/Instajam/libechoprint-codegen-ios.a
    

    It will likely tell you it is built for armv7 and armv7s. That will support all but the oldest iOS devices at the time of writing.

    You could build libechoprint-codegen-ios.a to run on a simulator. Here's a good stackoverflow post if you are interested in doing that: Build fat static library (device + simulator) using Xcode and SDK 4+

    The easiest option would be to just plug your phone in and not worry about building a fat static library. :D