[odb-users] Cannot cross compile libodb-sqlite for iOS

Alain-Serge Nagni asnagni at yahoo.com
Sat Aug 13 18:51:50 EDT 2016


Hi guys,
    I have been trying for several days now to compile ODB for iOS (I’m on MAC OS X  "El Capitan” ) following the guide line publish by Code Syntesis here (http://wiki.codesynthesis.com/Using_ODB_on_Mobile_and_Embedded_Systems <http://wiki.codesynthesis.com/Using_ODB_on_Mobile_and_Embedded_Systems>) . But I’m facing a problem with their libodb-sqlite package. When I try the build and install that package for some reason it cannot find the SQLite package that was cross compiled. Maybe someone someoneelse  faced this issue, some help will be appreciated.

So based on the Wiki page these are the steps that I’m performing to cross compile the library:


1) This is how I cross compile and install the libodb package (it works with out any problem):

./configure --host=arm-apple-darwin CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/" CXXFLAGS="-arch arm64 -std=c++14 -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk" CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" CXX="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" LD="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" AR="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar" --prefix=`pwd`/../install  --disable-shared


make
make install



2) This is how I cross compile the sqlite package (it works with out any problem):

./configure --host=arm-apple-darwin CXXFLAGS="—Os -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -arch arm64 -std=c++14 -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk" CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" CXX="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" LD="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" AR="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar" --prefix=`pwd`/../install  --disable-shared

make
make install




3) This is how I cross compile the libodb-sqlite package (It doesn’t work, it cannot find libsqlite )

./configure --host=arm-apple-darwin CFLAGS="-I`pwd`/../install/include" CPPFLAGS="-I`pwd`/../install/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/" LDFLAGS="-L`pwd`/../install/lib" CXXFLAGS="—Os -arch arm64 -std=c++14 -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk" CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" CXX="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" LD="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" AR="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar" --prefix=`pwd`/../install  --disable-shared --disable-threads


make 
make install


This is the error that I have when I cross compile libodb-sqlite :

checking whether /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ accepts -g... yes
checking dependency style of /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++... gcc3
checking how to run the C++ preprocessor... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -E
checking whether the /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... no
libtool.m4: error: problem compiling CXX test program
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ option to produce PIC...  -DPIC
checking if /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ PIC flag  -DPIC works... no
checking if /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ static flag  works... no
checking if /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ supports -c -o file.o... no
checking if /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ supports -c -o file.o... (cached) no
checking whether the /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... no
checking dynamic linker characteristics... darwin dyld
checking how to hardcode library paths into programs... immediate
configure: creating ./config.lt
config.lt: creating libtool
checking for libsqlite3... no
configure: error: libsqlite3 is not found; consider using CPPFLAGS/LDFLAGS to specify its location
make: *** No targets specified and no makefile found.  Stop.
make: Nothing to be done for `install'.
Alain-Serges-iMac:libodb-sqlite asnagni$ 



Thank you for your help,
Alain-Serge


More information about the odb-users mailing list