如果我使用库的标头运行 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/.'
我究竟做错了什么?或者这是一个没有希望的案例?