Skip to content

[Build] C++ API calling fail: error C2280: 'Ort::Value::Value(const Ort::Value &)' : attempt to reference a deleted function #15418

Open
@lucasjinreal

Description

@lucasjinreal

Describe the issue

error C2280: 'Ort::Value::Value(const Ort::Value &)' : attempt to reference a deleted function

Urgency

Very urgent

Target platform

windows

Build script

noio

Error / output

error C2280: 'Ort::Value::Value(const Ort::Value &)' : attempt to reference a deleted function

Here is the c++ caling code:

 std::vector<Ort::Value> ort_inputs;
  for (int i = 0; i < inputNames.size(); ++i) {
    auto ort_value = Ort::Value::CreateTensor<float>(
        memoryInfo, static_cast<float *>(inputs[i].data), inputs[i].get_size(),
        inputShapes[i].data(), inputShapes[i].size());
    assert(ort_value.IsTensor());
    ort_inputs.emplace_back(ort_value);
  }

try {
    std::vector<Ort::Value> ort_outputs;
    ort_outputs = session.Run(
        Ort::RunOptions{nullptr}, inputNames.data(), ort_inputs.data(),
        inputNames.size(), outputNames.data(), outputNames.size());
}

can not build

Visual Studio Version

2019

GCC / Compiler Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiissues related to all other APIs: C, C++, Python, etc.platform:windowsissues related to the Windows platform

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions