linux中sqlite3编译时出错,Sqlite3 交叉编译 undefined reference to `fdatasync' 错误解决
交叉編譯sqlite到Android平臺, Android.mk 文件內容如下:
LOCAL_PATH:= $(call my-dir)
INCDIR:=/home/android-ndk-r6b/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include
# first lib, which will be built statically
#
include $(CLEAR_VARS)
LOCAL_MODULE??? := cloudstore_MTD
LOCAL_SRC_FILES := debug.c? hash.c? fusex.cpp? listex.c? storex.cpp? md5.c main.c? markup.cpp? http_fet
cher.c spthreadpool.c
LOCAL_C_INCLUDES := /home/fuse-2.8.3/include /home/sqlite-autoconf-3070500? /home/android-ndk-r6b/platf
orms/android-9/arch-arm/usr/include /home/android-ndk-r6b/sources/cxx-stl/gnu-libstdc++/include /home/a
ndroid-ndk-r6b/samples/fuse-android/jni/include $(INCDIR)
LOCAL_CFLAGS :=-Wall -lulockmgr -pipe -D_FILE_OFFSET_BITS=64 -D_DEBUG -DANDROID_SDK -DUSE_OPEN -DUSE_TH
READ -DDEBUG -O2
LOCAL_CPPFLAGS :=
include $(BUILD_EXECUTABLE)
在jni目錄下面執行? /home/android-ndk-r6b/ndk-build? , 編譯, 總是出現如下錯誤:
[root@localhost jni]# /home/android-ndk-r6b/ndk-build
Compile thumb? : sqlite3_android <= shell.c
Compile thumb? : sqlite3 <= sqlite3.c
StaticLibrary? : libsqlite3.a
Executable???? : sqlite3_android
/home/android-ndk-r6b/samples/sqlite-android/obj/local/armeabi/libsqlite3.a(sqlite3.o): In function `unixSync':
sqlite3.c:(.text.unixSync+0x6): undefined reference to `fdatasync'
sqlite3.c:(.text.unixSync+0x14): undefined reference to `fdatasync'
collect2: ld returned 1 exit status
make: *** [/home/android-ndk-r6b/samples/sqlite-android/obj/local/armeabi/sqlite3_android]
搜索了好多地方, 找解決問題的辦法, 最后還是在官方bug列表里面找到了, 原來是一個bug, 下來就下載了最新的版本后, 重新編譯, 問題解決。
最新的版本為?? sqlite-autoconf-3070800.tar.gz
總結
以上是生活随笔為你收集整理的linux中sqlite3编译时出错,Sqlite3 交叉编译 undefined reference to `fdatasync' 错误解决的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 河北沧州有什么好吃的
- 下一篇: 美心家美平开玻璃门怎么样?