如何在 arm-v7 上编译 ftd2xxj?

How to compile ftd2xxj on arm-v7?

我已经在 c++ 和 Python 的 arm-v7 上成功使用 FTDI D2XX driver,但我现在需要使用 java。

另外,我已经成功使用了ftd2xxj JNI wrapper on Windows and OSX using this modified ftd2xxj project

请注意,我对 JNI 和 Makefile 还不是很熟悉。

问题是我似乎无法从源代码编译 ftd2xxj 项目。 OSX 修改版本依赖于 xcodebuild,我不确定如何将其转换为 cmake/Makefiles。 (我确实快速浏览了 pbxbuild and buildtool 但不知道如何使用)。

我已经从 sourceforge 中检查了原始的 ftd2xxj 源代码并在 eclipse 中导入了项目,但是我运行遇到了一些问题:

ftd2xxj Java 项目正在引用存储库中不存在的 javax.util 项目,我不确定在哪里可以找到它。我认为这可能与我在预编译二进制文件中发现的 javax.util.属性.2_0.jar 有关。作为一个 hacky 解决方法,我创建了一个空白的 javax.util 项目并将 .jar 文件添加到项目中,要求它防止 eclipse 抱怨(但这可能会弄乱原始配置)。

简而言之:我无法编译原始的 ftd2xxj 项目(到目前为止,因为 javax.util.properties 库缺少 javax.util 项目),我想编译该项目arm-v7(使用 eclipse 或 Makefiles)

关于如何编译项目的任何 hints/tips?

此处供参考的是 ant:

的输出
build-all:
build-application:
init:
     [echo] Start time: 25-November-2015 : 16:55:24
     [echo] Used JDK: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
     [echo] !!! Be sure to use a Java SDK !!!
     [echo] Project classpath: 
compile-application-release:
clean-application:
clean-application-docs:
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/build.xml:216: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 36 source files to /Users/georgeprofenza/Documents/eclipse/ftd2xxj/target/application/bin
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:8: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/EEPROM.java:3: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Port.java:3: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/DeviceDescriptor.java:3: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/FTStatus.java:5: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:14: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:15: package javax.util.property does not exist
    [javac] import javax.util.property.Property;
    [javac]                           ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:16: package javax.util.property does not exist
    [javac] import javax.util.property.PropertyPersistenceManager;
    [javac]                           ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:25: package javax.util does not exist
    [javac] import javax.util.Localizer;
    [javac]                  ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:59: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(defaultValue = " ")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:65: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(key = "com.ftdichip.ftd2xx.Device.writeTimeout", defaultValue = "300")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:71: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(key = "com.ftdichip.ftd2xx.Device.readTimeout", defaultValue = "300")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:77: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(key = "com.ftdichip.ftd2xx.Device.latencyTimer", defaultValue = "-1")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:83: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(key = "com.ftdichip.ftd2xx.Device.resetPipeRetryCount", defaultValue = "-1")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:89: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(key = "com.ftdichip.ftd2xx.Device.usbReceiveBufferSize", defaultValue = "-1")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:95: cannot find symbol
    [javac] symbol  : class Property
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]     @Property(key = "com.ftdichip.ftd2xx.Device.usbTransmitBufferSize", defaultValue = "-1")
    [javac]      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:142: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalStateException(Localizer.getLocalizedMessage(
    [javac]                                             ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:155: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalStateException(Localizer.getLocalizedMessage(
    [javac]                                             ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:302: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:347: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:454: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:545: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:608: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:657: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:661: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:695: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:770: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:774: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:780: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             logger.fine(Localizer.getLocalizedMessage(Device.class,
    [javac]                         ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:879: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:883: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Device.java:887: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Device
    [javac]             logger.fine(Localizer.getLocalizedMessage(Device.class,
    [javac]                         ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/EEPROM.java:33: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.EEPROM
    [javac]             throw new IllegalStateException(Localizer.getLocalizedMessage(
    [javac]                                             ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Port.java:58: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Port
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Port.java:92: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Port
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Port.java:163: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Port
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Port.java:190: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Port
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/DeviceDescriptor.java:106: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.DeviceDescriptor
    [javac]             throw new InvalidDeviceDescriptorException(Localizer
    [javac]                                                        ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/FTStatus.java:146: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.FTStatus
    [javac]         return Localizer.getLocalizedMessage(FTStatus.class, status.toString());
    [javac]                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/FTStatus.java:164: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.FTStatus
    [javac]             String message = Localizer.getLocalizedMessage(FTStatus.class,
    [javac]                              ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:107: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]             logger.log(Level.SEVERE, Localizer.getLocalizedMessage(
    [javac]                                      ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:129: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]         logger.config(Localizer.getLocalizedMessage(Service.class,
    [javac]                       ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:147: cannot find symbol
    [javac] symbol  : variable PropertyPersistenceManager
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]             PropertyPersistenceManager
    [javac]             ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/Service.java:150: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.Service
    [javac]             throw new RuntimeException(Localizer.getLocalizedMessage(
    [javac]                                        ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:103: cannot find symbol
    [javac] symbol: variable Localizer
    [javac]                             String title = Localizer.getLocalizedMessage(
    [javac]                                            ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:107: cannot find symbol
    [javac] symbol: variable Localizer
    [javac]                             String message = Localizer.getLocalizedMessage(
    [javac]                                              ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:147: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.ui.deviceTree.DevicesTreePanel
    [javac]             text = Localizer.getLocalizedMessage(DevicesTreePanel.class,
    [javac]                    ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:151: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.ui.deviceTree.DevicesTreePanel
    [javac]             text = Localizer.getLocalizedMessage(DevicesTreePanel.class,
    [javac]                    ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:211: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.ui.deviceTree.DevicesTreePanel
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] /Users/georgeprofenza/Documents/eclipse/ftd2xxj/src/application/com/ftdichip/ftd2xx/ui/deviceTree/DevicesTreePanel.java:223: cannot find symbol
    [javac] symbol  : variable Localizer
    [javac] location: class com.ftdichip.ftd2xx.ui.deviceTree.DevicesTreePanel
    [javac]             throw new IllegalArgumentException(Localizer.getLocalizedMessage(
    [javac]                                                ^
    [javac] 50 errors

BUILD FAILED
/Users/georgeprofenza/Documents/eclipse/ftd2xxj/build.xml:107: The following error occurred while executing this line:
/Users/georgeprofenza/Documents/eclipse/ftd2xxj/build.xml:112: The following error occurred while executing this line:
/Users/georgeprofenza/Documents/eclipse/ftd2xxj/build.xml:216: Compile failed; see the compiler error output for details.

Total time: 2 seconds

更新 1 我在最初的基于 eclipse 的项目上取得了一些进展,并设法从 ftd2xxj 项目 运行 构建了 ant,它似乎生成了 JNI headers,但它似乎没有编译 JNI图书馆。 (我没有在 ant file 中发现任何指向除 JNI headers 以外的任何 JNI 相关的内容)。目前还不清楚编译 JNI 库的推荐方法是什么(现在 headers 已经准备好了)。

我注意到有一个 com.ftdichip.ftd2xx.linux.x86, which is referenced from the ftd2xxj,但我不确定它是如何使用的,如果我想创建 com.ftdichip.ftd2xx.linux.armv7 文件夹,如何我这样做吗?

更新 2 我注意到 com.ftdichip.ftd2xx 项目的 eclipse 标志有问题:

An API baseline has not been set for the current workspace Based on I've set preferences to Warn instead of Error. I hope this won't cause major problems

我在 eclipse 项目上取得了进一步的进展,并注意到 ftd2xx-native 项目发生了一些变化。它尝试基于 Makefile 进行编译,但失败了:

19:14:51 **** Incremental Build of configuration linux-i386 for project ftd2xxj-native ****
make all 
Building file: ../src/device.c
Invoking: GCC C Compiler
gcc -I/home/pi/eclipse/ftd2xxj-native/external/include -I/include -I/include/linux -O0 -Wall -c -fmessage-length=0 -fPIC -m32 -MMD -MP -MF"src/device.d" -MT"src/device.d" -o"src/device.o" "../src/device.c"
gcc: error: unrecognized command line option ‘-m32’
src/subdir.mk:39: recipe for target 'src/device.o' failed
make: *** [src/device.o] Error 1

19:14:51 Build Finished (took 246ms)

我注意到 -m32 标志,当我尝试编辑 src/subdir.mk 文件时,我收到一条警告,文件已生成。我仍然不确定这些 Make 文件是如何生成的。这方面的任何提示都会有所帮助

更新 3 我现在注意到 ftd2xxj-native 是 JNI C 项目并且通过 Eclipse CDT 有一些额外的设置。我可以看到 -m32 标志,但无法更改设置。我正在查看 CDT 文档。任何关于通过 CDT 配置和编译 JNI 项目的 hints/tips 将不胜感激

我认为这可能是因为您正在尝试使用 JRE 而不是 Java JDK ?

来编译您的项目

在控制台中尝试 Java --version 并查看是否安装了 JDK。如果没有,请从 Oracle 下载它,确保将其放入您的 Path 和 JAVA_HOME 变量中。

原来有很多东西要设置。 我使用 eclipse 3.8.1 和 CDT 8.5.0.

在 Raspberry PI 2 上编译了项目

使用此版本导致单个 API 基线错误,在 Preferences > Plug-in Development > API Baselines 中可以将其设置为警告而不是错误,如果有任何缺失。

我不得不更改 JRE(缺少原始项目中使用的 J2SE01.5),但系统上存在 java 7 openJDK 和 Oracle JDK 8。

我在编译器标志方面寻找的大部分设置都存在于 C/C++ Build > Settings[=21 下的 ftd2xx-native 项目属性中=]

有我用过的设置: C 编译器包括

/usr/lib/jvm/java-7-openjdk-armhf/include
/usr/lib/jvm/java-7-openjdk-armhf/include/linux
"${workspace_loc:/${ProjName}/external/include}"

C 编译器标志(Miscaleneous > 其他标志)

-c -fmessage-length=0 -fPIC -march=armv7-a -mfloat-abi=hard -ftree-vectorize -Wno-psabi -pipe-c -fmessage-length=0 -fPIC -march=armv7-a -mfloat-abi=hard -ftree-vectorize -Wno-psabi -pipe

C 链接器库 (-l)

jvm
ftd2xx

C 链接器库搜索路径(-L)

/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/lib/arm/client
"${workspace_loc:/${ProjName}/external}"

我最初使用 java 7 openjdk 路径,但客户端库在某个时候消失了(不确定清理 c++ 项目是否与此有关)

错位 > 其他标志

--no-undefined

共享库设置

Shared is on (-shared) 共享对象名称

lib${BuildArtifactFileName}.${MAJOR_VERSION}

MAJOR_VERSIONMINOR_VERSIONC/C++ Build > Build Variables(作为字符串)

中定义

希望这可以帮助任何其他试图在不同平台上编译此 JNI 包装器的人

我使用这些库的条款,值得注意驱动程序的自述文件,尤其是关于卸载串行驱动程序和 运行 java 使用此库时作为 sudo 的自述文件:

If the message "FT_Open failed" appears: Perhaps the kernel automatically loaded another driver for the FTDI USB device.

sudo lsmod

If "ftdi_sio" is listed:
    Unload it (and its helper module, usbserial), as follows.

    sudo rmmod ftdi_sio
    sudo rmmod usbserial

Otherwise, it's possible that libftd2xx does not recognise your 
device's Vendor and Product Identifiers.  Call FT_SetVIDPID before
calling FT_Open/FT_OpenEx/FT_ListDevices.