Ich versuche, React Native und C++ mit Djinni zu kombinieren, aber ich bin mir nicht sicher, wie man richtig vorgeht, wie man die C++ Bibliotheken in iOS/Android Projekte verbindet.Hinzufügen von C++ mit Djinni zu einem React Native Projekt
ich das Helloworld iOS Tutorial folgte auf mobilecpptutorials.com und sah auch in den github.com/boloutaredoubeni/Twenty48 Repo, aber ich bin fest, wenn Bibliotheken kompilieren.
Als ich make ios
nach Link Binaries With Libraries
, ich habe diese Fehlermeldung, dass jni.h
nicht gefunden wird:
/Users/mathieu/Projects/ReactNativeCPP/src/third_party/djinni/support-lib/jni/djinni_support.hpp:28:10: fatal error:
'jni.h' file not found
#include <jni.h>
Und am Ende dieses:
** BUILD FAILED **
The following build commands failed:
CompileC /Users/mathieu/Library/Developer/Xcode/DerivedData/ReactNativeCPP-hitrjcfdokrbvneddelnwjucurrw/Build/Intermediates/librncpp.build/Debug-iphonesimulator/librncpp_objc.build/Objects-normal/x86_64/NativeSortItems.o /Users/mathieu/Projects/ReactNativeCPP/src/third_party/djinni/example/generated-src/jni/NativeSortItems.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Reaping losing child 0x7fc210600fc0 PID 35024
make: *** [ios] Error 65
Removing child 0x7fc210600fc0 PID 35024 from chain.
Ich verstehe nicht, warum das Beispiel Projekt bei djinni/example/generated-src/jni/NativeSortItems.cpp
wirft einen Fehler, ich verwende es nicht ...
Nur müssen libdjinni_objc.a
hinzufügen und librncpp_objc.a
in Link Binaries With Libraries
auf Xcode, um den Fehler zu reproduzieren.
Was ist los mit der Art, wie ich vorgehe?
Vielen Dank!
Vielen Dank für Ihre Hilfe! Ich habe das Tutorial neu gestartet und folge streng der Ordnerstruktur und Dateinamen, und es funktioniert jetzt korrekt auf iOS. Habe noch ein paar Probleme mit Android, aber sobald ich etwas stabil habe, werde ich es teilen. – mathieu