0

I want to configure a c library to work with Xcode . I am new to this and can’t find much information regards this . First i tried to create a static library to drag and drop all the c files but it didn’t worked because it has dependency . The library i am trying to change to iOS is net-snmp . Further investigation i found we can change a c library to iOS specific using configure , make command . I followed a tutorial and tried to configure using below command in terminal but ended up with an error .

./configure --disable-shared --enable-utf8 --host=arm-apple-darwin CFLAGS="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk" CXXFLAGS="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk" LDFLAGS="-L." CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc" CXX="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++"

The error is

configure: error: You are cross-compiling, but you have not specified the target's endianness

Am not sure am in the right track . If anybody done successfully changed a c library to iOS specific .? If yes how to do that .? any help is appreciated .

Thanks

Sat
  • 1,616
  • 3
  • 22
  • 40
  • Possible duplicate of [Compiling external C++ library for use with iOS project](http://stackoverflow.com/questions/27016612/compiling-external-c-library-for-use-with-ios-project) – Mobile Ben Sep 15 '16 at 06:26

1 Answers1

0

You can pass another argument to configure script: --with-endianness=little. (As far as I remember, iOS runs on little endian platform)

You can get this information by running ./configure --help | grep endian

Mathieu
  • 8,840
  • 7
  • 32
  • 45