error: reference to ‘DataType’ is ambiguous
 ICudaEngine* createEngine(unsigned int maxBatchSize, IBuilder* builder, IBuilderConfig* config, DataType dt)

这个问题很奇怪,没有明显错误。找了一会儿定位问题在命名空间的问题。
我把开头的

using namespace cv;
using namespace std;

这两行注释掉就解决问题了。

所以总结问题应该是:
tensorrt与std或者cv里面的类型或者函数有一样的名字导致的冲突。然后就是去掉using namespace,后面加作用域,比如std::,cv::Mat等。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2021-10-29
  • 2021-08-12
  • 2022-12-23
  • 2021-07-03
  • 2021-05-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2021-06-11
相关资源
相似解决方案