Reputation: 3192
I am facing a problem with JNI when I run the makefile with the target all
This is my problem:
**** 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
Do you know what the problem is?
EDIT
If I try to cancell it from the makefile this problem is triggered
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
Upvotes: 2
Views: 2895
Reputation: 33
As per this link http://www.delorie.com/gnu/docs/binutils/ld_4.html
So a working solution is just remove it (..std..alisa..) and your gcc command now becomes:
gcc -Wl -shared -o Tape.dll TestTape.o
Upvotes: 1