使用JNAerator访问Mac OSX下的库

时间:2016-06-06 18:32:25

标签: java macos jna jnaerator

如果我使用我的库的标题运行JNAerator,那么进程会占用处理器时间并且似乎永远不会完成 - 在首次发出警告之后:

adrian$ java -Xmx128m -jar ~/JNAerator/jnaerator/target/jnaerator-0.13-SNAPSHOT-shaded.jar /Users/adrian/DRAMSim2/DRAMSim.h -mode StandaloneJar
Warning: no -library option for file 'DRAMSim.h', using "DRAMSim".
Auto-configuring parser...
Parsing native headers...

/usr/include/sys/cdefs.h:74:25: warning: #warning "Unsupported compiler detected"
/usr/include/_types/_wctype_t.h:30:19: warning: No newline before end of file

所以,我也尝试过-ScanSymbols选项:

java -Xmx128m -jar ~/JNAerator/jnaerator/target/jnaerator-0.13-SNAPSHOT-shaded.jar -scanSymbols  -mode StandaloneJar
Auto-configuring parser...
Parsing native headers...
Normalizing parsed code...
Generating libraries...


Compiling JNAerated files...


[....]


Copying runtime classes...
Generating out.jar
#
# SUCCESS: JNAeration completed !
# Output mode is 'StandaloneJar(JAR with bindings and runtime dependencies)
#
# => '/Users/adrian/groovy/simul/src/simul/./out.jar'

out.jar有很多.class文件,但没有.java,我不知道如何使用它。

根据wiki的建议使用-noComp -noJar根本不会产生任何输出......

adrian$ java -Xmx128m -jar ~/JNAerator/jnaerator/target/jnaerator-0.13-SNAPSHOT-shaded.jar -scanSymbols  -noComp -noJar
WARNING: option (?i)-noComp is deprecated and might be removed in future versions.
WARNING: option (?i)-noJar is deprecated and might be removed in future versions.
WARNING: legacy options (?i)-noJar and (?i)-noComp used, defaulting -mode to Directory
Auto-configuring parser...
Parsing native headers...
Normalizing parsed code...
Generating libraries...

#
# SUCCESS: JNAeration completed !
# Output mode is 'Directory(Bindings sources in simple file hierarchy)
#
# => '/Users/adrian/groovy/simul/src/simul/.'

我做错了什么?或者这是一个无望的案例?

0 个答案:

没有答案