Home > Blockchain >  Why do I get a not declared in this scope error even though the header file is included?
Why do I get a not declared in this scope error even though the header file is included?

Time:04-07

The error I get is

/opt/workspace/IhmActon/ihm_acton/src/model_inference/retinanet/engine.cpp:213:5:
error: ‘trt_unique_ptr’ was not declared in this scope
     trt_unique_ptr<trt::IHostMemory> serialized_engine = wrap_trt_ptr(engine->serialize());

This is a photo snippet of that function and where the error is enter image description here

The declaration of trt_unique_ptr is in this header file(tensorrt.hpp). enter image description here

In engine.hpp, I have an import statement to include that header file - #include "model_optimizer/tensorrt.hpp" . I do not see any errors with the import statement

Why do I still get this not declared in scope error?

CodePudding user response:

trt_unique_ptr is inside namespace ihm_springfield. Use ihm_springfield::trt_unique_ptr instead.

  •  Tags:  
  • c
  • Related