2012-06-17 44 views
0
[email protected]:~/workspace/JNI2/src$ ls 
Prompt.c Prompt.class Prompt.h Prompt.java 

[email protected]:~/workspace/JNI2/src$ gcc --shared -o libPrompt.so -I/usr/lib/jvm/java-6-openjdk-i386/include -I/usr/lib/jvm/java-6-openjdk-i386/include/linux -lX11 Prompt.c /usr/lib/jvm/java-6-openjdk-i386/jre/lib/i386/server/libjvm.so 
Prompt.c:2:20: fatal error: Prompt.h: No such file or directory 
compilation terminated. 


Prompt.c : 
#include <jni.h> 
#include <Prompt.h> 
........ 

什麼我不undestand?創建.so庫致命錯誤...... .h沒有這樣的文件或目錄

+1

嘗試改用'#包括 「Prompt.h」' – hmjd

+1

嘗試改變包括線'的#include「提示.h「'用雙引號,而不是< > –

+0

......謝謝你們。 – drifter

回答

1

至於評論,更改爲:

#include "Prompt.h" 

The #include directive

 
#include <file> 
    This variant is used for system header files. 
    It searches for a file named file in a list of directories 
    specified by you, then in a standard list of system directories. 
    You specify directories to search for header files with the 
    command option `-I' (see section 1.9 Invoking the C Preprocessor). 
    The option `-nostdinc' inhibits searching the standard system 
    directories; in this case only the directories you specify are searched. 

#include "file" 
    This variant is used for header files of your own program. 
    It searches for a file named file first in the current directory, 
    then in the same directories used for system header files. 
    The current directory is the directory of the current input file. 
    It is tried first because it is presumed to be the location of the 
    files that the current input file refers to. 
    (If the `-I-' option is used, the special treatment of the 
    current directory is inhibited.) 
相關問題