OrtSessionHandler.hpp:15:20: fatal error: optional: No such file or directory
tcxia opened this issue · comments
#include <onnxruntime/core/providers/cuda/cuda_provider_factory.h>
#include <onnxruntime/core/session/onnxruntime_cxx_api.h>
因为这两个文件报错?
Hi,
Have you used my script to install onnxruntime from source?
Also in CmakeLists you also need to specify onnxruntime_INCLUDE_DIRS, like this
set(onnxruntime_INSTALL_PREFIX /usr/local)
set(onnxruntime_INCLUDE_DIRS
${onnxruntime_INSTALL_PREFIX}/include/onnxruntime
${onnxruntime_INSTALL_PREFIX}/include/onnxruntime/core/session
)
and include it
I have installed it, but I can't find the #include file. It seems to be C++17 only!
yes. I have used some small functions (std::optional) of C++17, so currently support C++17 only. Those parts of C++17 can be rewritten into C++11 actually. Please test with C++17 first. If you need to port it into C++11, I can help.
I will close the issue now. Feel free to open it again if troubles happen.
Solved. Just in case anyone need.
std::optional to boost::optional
std::nullopt to boost::none
.has_value to .is_initialized()