簡體   English   中英

無法用ndk-build構建修改過的android-fuse

[英]Can't build modified android-fuse with ndk-build

在使用ndk-build進行編譯時,我收到以下錯誤:

/* this is the output*/
alex@ubuntu:~/NDKDemo$ ndk-build
Compile thumb  : fusexmp <= fusexmp.c
Compile thumb  : fuse <= cuse_lowlevel.c
Compile thumb  : fuse <= fuse.c
Compile thumb  : fuse <= fuse_kern_chan.c
Compile thumb  : fuse <= fuse_loop.c
Compile thumb  : fuse <= fuse_loop_mt.c
Compile thumb  : fuse <= fuse_lowlevel.c
Compile thumb  : fuse <= fuse_mt.c
Compile thumb  : fuse <= fuse_opt.c
Compile thumb  : fuse <= fuse_session.c
Compile thumb  : fuse <= fuse_signals.c
Compile thumb  : fuse <= helper.c
Compile thumb  : fuse <= mount.c
Compile thumb  : fuse <= mount_util.c
jni/mount_util.c: In function 'add_mount_legacy':
jni/mount_util.c:91: warning: assignment makes pointer from integer without a cast
Compile thumb  : fuse <= ulockmgr.c
StaticLibrary  : libfuse.a
Executable     : fusexmp
/home/alex/Downloads/android-ndk-r7/platforms/android-14/arch-arm/usr/lib/crtbegin_dynamic.o: In function `_start':
(.text+0x14): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/fusexmp] Error 1

我修改了fusexmp.c修改如下:

#include "com_alex_NativeLib.h"
............................ //fuse specific code which build succesfully
.............................
/* Callable native function signature from Java*/
JNIEXPORT jint JNICALL Java_com_marakana_NativeLib_hello_fuse
  (JNIEnv * env, jobject obj) {
char *v[2];
    v[0]=(char*)malloc(90); //argv[0] for fuse_main
    v[1]=(char*)malloc(90); //argv[1] for fuse_main
    strcpy( v[0],"hello");
    strcpy(v[1],"./helloxmp"); //path to mount point

    umask(0); 
    return fuse_main(2, v, &xmp_oper, NULL); //the fuse main call
}

問題是ndk-build正在嘗試將fusexmp構建為可執行文件,但似乎fusexmp沒有定義main函數(編譯器需要創建可執行文件)。 創建一個main函數作為可執行文件的入口點,或者將fusexmp更改為庫,方法是在您的Android.mk更改include $(BUILD_EXECUTABLE)include $(BUILD_SHARED_LIBRARY)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM