运行makefile——add-stdcall-alias时的JNI问题
Issue with JNI when run makefile --add-stdcall-alias
当我用目标all运行makefile时,我遇到了JNI问题
这是我的问题:
**** Build of configuration Default for project TestTapeJNI ****
make all
javah -classpath ../bin TestTape
gcc -I"/home/tanio/DevelopmentEnvironment/jdk1.7.0_51/include"I"/home/tanio/DevelopmentEnvironment/jdk1.7.0_51/include/linux" -c TestTape.c -o TestTape.o
gcc -Wl,--add-stdcall-alias -shared -o Tape.dll TestTape.o
/usr/bin/ld: unrecognized option '--add-stdcall-alias'
/usr/bin/ld: use the --help option for usage information collect2: ld returned 1 exit status
make: *** [Tape.dll] Error 1
你知道是什么问题吗?
编辑
如果我试图从makefile中取消它,则会触发此问题
make all
javah -classpath ../bin TestTape
gcc -Wl, -shared -o Tape.dll TestTape.o
/usr/bin/ld: cannot find : No such file or directory
collect2: ld returned 1 exit status
make: *** [Tape.dll] Error 1
MAKEFILE
# Define a variable for classpath
CLASS_PATH = ../bin
# Define a virtual path for .class in the bin directory
vpath %.class $(CLASS_PATH)
all : Tape.dll
# $@ matches the target, $< matches the first dependancy
Tape.dll : TestTape.o
gcc -Wl, -shared -o $@ $<
# $@ matches the target, $< matches the first dependancy
TestTape.o : TestTape.c TestTape.h
gcc -I"/home/tanio/DevelopmentEnvironment/jdk1.7.0_51/include" -I"/home/tanio/DevelopmentEnvironment/jdk1.7.0_51/include/linux" -c $< -o $@
# $* matches the target filename without the extension
TestTape.h : TestTape.class
javah -classpath $(CLASS_PATH) $*
clean :
rm TestTape.h TestTape.o Tape.dll
按此链接http://www.delorie.com/gnu/docs/binutils/ld_4.html
所以一个有效的解决方案是删除它(. std. alisa.),你的gcc命令现在变成:gcc -Wl -shared -o Tape.dll TestTape.o
相关文章:
- JNI 日期值转换问题,在C++中获取不同的长整型值
- JNI/C++编译问题
- 如何在不产生 JNI 问题的情况下转换 byte[] -> uint8_t[]?
- JNI 中的内存问题
- 使用JNI从Java调用本机(C++)函数时发生访问冲突:这是我的代码问题,还是已知问题
- JNI与共享对象有问题
- 在JNI创建的dll中使用dll的问题
- 通过JNI执行OpenCV本机函数的问题
- JNI在将Java double转换为jdouble时出现问题
- 使用JNI时出现实例和类变量状态问题
- 关于安卓系统上的JNI的问题
- JNI 问题:DLL 中的文件句柄出现符号查找错误C++
- dll 文件的 JNI 问题
- Android NDK / General JNI 问题:将对象/jobject 转换为 c++ 用户 defiend
- 从java到c++jni android arm64-v8a 32/64位的传递mat问题
- 使用OpenGL ES、JNI和C++的安卓系统上的框架似乎出现了问题
- JNI-从jstring到字节的传输,从字节到字符串的传输问题
- jni原生方法问题
- C++/JNI-存储对象(jobject)在向量和数组中发生意外更改,C++或JNI问题
- 运行makefile——add-stdcall-alias时的JNI问题