gpt4 book ai didi

c - 包含 jni.h : No such file or directory, 路径

转载 作者:行者123 更新时间:2023-11-30 15:42:20 29 4
gpt4 key购买 nike

我正在尝试构建一个使用 SWIG 创建的包装器。当我尝试构建该文件时,出现错误,指出未找到 jni.h。我有使用 -I 标志指定的正确路径,但它仍然找不到它。我正在使用 cygwin 在 Windows 上构建。我做错了什么?

$ gcc -c zinnia_wrap.c -I "/C/Program Files \( x86\)/Java/jdk1.6.0_23/include"
-I "/C/Program Files \(x86\)/Java/jdk.1.6.0_23/include/win32"
zinnia_wrap.c:135:17: jni.h: No such file or directory
zinnia_wrap.c:159: error: parse error before '*' token
zinnia_wrap.c: In function `SWIG_JavaThrowException':
zinnia_wrap.c:160: error: `jclass' undeclared (first use in this function)
zinnia_wrap.c:160: error: (Each undeclared identifier is reported only once
zinnia_wrap.c:160: error: for each function it appears in.)
zinnia_wrap.c:160: error: parse error before "excep"
zinnia_wrap.c:175: error: `code' undeclared (first use in this function)
zinnia_wrap.c:178: error: `jenv' undeclared (first use in this function)
zinnia_wrap.c:179: error: `excep' undeclared (first use in this function)
zinnia_wrap.c:181: error: `msg' undeclared (first use in this function)

最佳答案

好的,我知道出了什么问题了。除了将/cygdrive/添加到路径前面(感谢@krsteeve)之外,我还需要将“/Program Files\(x86\)/”更改为“/Program Files (x86)/”。我第一次在没有“\”的情况下尝试它,它向我提示,但现在它可以工作了。完整的工作命令如下:

$ gcc -c zinnia_wrap.c -I "/cygdrive/c/Program Files (x86)/Java/jdk1.6.0_23/include" 
-I "/cygdrive/c/Program Files (x86)/Java/jdk1.6.0_23/include/win32"

关于c - 包含 jni.h : No such file or directory, 路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20184834/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com