Open anhthoai opened 1 year ago
Hello @shaoshengsong, I have tried to build in Windows, but there is error as screenshot, I don't know why. I can't see any error at that line. Could you please help me on that?
This is information:
May I ask how it was resolved?
解决了吗?老哥
May I ask how it was resolved? plz...
ok... i solved it!!
in windows. Ort::Session 's second parameter is "const wchar_t*"
we need to make function stringToWString
edit FeatureTensor.h
Ort::Session session_{env, k_feature_model_path.c_str(), Ort::SessionOptions{nullptr}};
to
#include <windows.h>
std::wstring stringToWString(const std::string& str) {
if (str.empty()) return std::wstring();
int sizeNeeded = MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), NULL, 0);
std::wstring wstrTo(sizeNeeded, 0);
MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), &wstrTo[0], sizeNeeded);
return wstrTo;
}
Ort::Session session_{env, stringToWString(k_feature_model_path).c_str(), Ort::SessionOptions{nullptr}};