diff --git a/hi_tools/hi_neural/onnx_loader.h b/hi_tools/hi_neural/onnx_loader.h index ed51dd400..2db12718b 100644 --- a/hi_tools/hi_neural/onnx_loader.h +++ b/hi_tools/hi_neural/onnx_loader.h @@ -64,7 +64,8 @@ class ONNXLoader: public ReferenceCountedObject template Func getFunction(const String& name) { - if(auto f = static_cast(dll->getFunction(name))) + + if(auto f = reinterpret_cast(dll->getFunction(name))) return f; else { @@ -80,4 +81,4 @@ class ONNXLoader: public ReferenceCountedObject JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ONNXLoader); }; -} // namespace hise \ No newline at end of file +} // namespace hise diff --git a/tools/onnx_lib/Readme.md b/tools/onnx_lib/Readme.md index a5571ec88..9948c04ed 100644 --- a/tools/onnx_lib/Readme.md +++ b/tools/onnx_lib/Readme.md @@ -2,10 +2,14 @@ This project will build a dynamic library that wraps the ONNX runtime and can be loaded dynamically (the official ONNX runtime release needs to be linked dynamically). +For now I won't include the compiled library so you have to build it yourself if you want to use that feature... + ## Build instructions Download the static library builds from [here](https://github.com/csukuangfj/onnxruntime-libs/releases) and move the static library files into `Source/lib/Debug/` / `Source/lib/Release/` then open the projucer project and compile the dynamic libraries. +> Note that on macOS you might have to use an older release because of some weird C++ library errors. [That](https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.17.3/onnxruntime-osx-universal2-static_lib-1.17.3.zip) one worked for me (Universal binary) + If all went through fine, put the `.dll` / `.dylib` file into the this directory so that will be picked up by HISE. ## Deployment diff --git a/tools/onnx_lib/Source/Main.cpp b/tools/onnx_lib/Source/Main.cpp index edde51a10..c11e77a2e 100644 --- a/tools/onnx_lib/Source/Main.cpp +++ b/tools/onnx_lib/Source/Main.cpp @@ -1,5 +1,10 @@ + + #include + + + #if JUCE_WINDOWS /** \internal */ #define DLL_EXPORT extern "C" __declspec(dllexport) diff --git a/tools/onnx_lib/onnx_hise_library.jucer b/tools/onnx_lib/onnx_hise_library.jucer index e6bf880df..17ef8ff28 100644 --- a/tools/onnx_lib/onnx_hise_library.jucer +++ b/tools/onnx_lib/onnx_hise_library.jucer @@ -1,57 +1,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +