This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
building:start [2022/06/17 16:19] – ursgraf | building:start [2022/06/30 13:53] (current) – [Java Part] ursgraf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Building ====== | ====== Building ====== | ||
- | The dll (from C sources) and jar-file (from java sources) must be built separately. Checkout from [[https:// | + | The dll (from C sources) and jar-file (from java sources) must be built separately. Checkout from [[https:// |
- | ===== Java Part ===== | + | ===== C++ Code ===== |
+ | Source code is under / | ||
- | |||
- | In Eclipse with Plugin Development capability: | ||
- | * File -> Import -> Existing Projects into Workspace | ||
- | * Browse -> LibusbJava_Java | ||
- | * Finish | ||
- | * Export -> jar file | ||
- | |||
- | Falls Änderungen an Libusb.java gemacht wurden, muss das Headerfile für die libusbJava_C Bibliothek neu erstellt werden. | ||
- | * Project -> Build All | ||
- | Konsole öffnen und zum bin-Ordner im aktuellen Java Workspace wechseln. | ||
- | Unter Windows folgenden command ausführen: | ||
- | < | ||
- | "Pfad zu aktuellem JDK\bin\javah.exe" | ||
- | </ | ||
- | Für Linux: | ||
- | < | ||
- | $javah ch.ntb.inf.libusb.Libusb | ||
- | </ | ||
- | |||
- | Anmerkung: javah wurde bei neuern JDKs durch '' | ||
- | < | ||
- | javac -h . ch\ntb\inf\libusb\Libusb.java | ||
- | </ | ||
- | |||
- | Das generierte Headerfile nun nach LibusbJava_C kopieren kopieren. | ||
- | |||
- | ===== C++ Code ===== | ||
- | * Eclipse C starten | ||
- | * File -> Import -> Existing Projects into Workspace | ||
- | * Browse -> LibusbJava_C | ||
- | * Finish | ||
==== Windows ==== | ==== Windows ==== | ||
- | MinGW installieren: | + | * install |
- | [[https:// | + | * use cmake to build the project |
- | * Architektur auswählen | + | |
- | * für Threads " | + | |
- | * next | + | |
- | * installieren und finish | + | |
- | CMake:\\ | ||
- | * cmake gui starten | ||
- | * Bei source code Pfad zu LibusbJava_C eintragen | ||
- | * Bei build the binaries: Pfad zu ./build (32 oder 64) | ||
- | * Configure -> MinGW Makefile auswählen und bestätigen | ||
- | * Configure | ||
- | * Generate | ||
- | Rechtsklick auf Projekt: | + | ==== Linux ==== |
- | * Properties -> C/C++ Build -> Settings | + | * <code>g++ -shared |
- | * Unter GCC C++ Compiler | + | * Copy so-file to /usr/lib |
- | * < | + | |
- | * < | + | |
- | * Unter MinGW C++ Linker | + | |
- | * Libraries | + | |
- | * < | + | |
- | * Library search path -> Add | + | |
- | * < | + | |
- | * Änderungen am Code vornehmen | + | |
- | * Rechtsklick auf Projekt | + | |
- | * Alternativ: mit der Konsole zum Ordner | + | |
- | * < | + | |
- | * Je nach Kompiler könnte es beim Cast von bool zu jboolean Probleme geben | + | |
- | * Erstellte .dll kopieren nach <file> | + | |
+ | ===== Java Part ===== | ||
+ | Source code is under / | ||
- | ==== Linux ==== | + | |
- | | + | * If changes were made in //Libusb.java// -> remake header file for LibusbJava_C with < |
- | * Bash zu LibusbJava_C Ordner | + | $javah ch.ntb.inf.libusb.Libusb |
- | * < | + | </ |
- | * Erstellte | + | |