我在 VS2022 中用 c++ 编写了以下几行代码。
class Logger : public ILogger
{
void log(Severity severity, const char* msg) noexcept override
{
// suppress info-level messages
if (severity <= Severity::kWARNING)
std::cout << msg << std::endl;
}
} logger;
int main()
{
IBuilder* builder = createInferBuilder(logger);
}
我收到以下错误:
Severity Code Description Project File Line Suppression State Details
Error LNK2019 unresolved external symbol createInferBuilder_INTERNAL referenced in function "class nvinfer1::IBuilder * __cdecl nvinfer1::`anonymous namespace'::createInferBuilder(class nvinfer1::ILogger &)" (?createInferBuilder@?A0xc427fcb5@nvinfer1@@YAPEAVIBuilder@2@AEAVILogger@2@@Z) Build_Engine_File C:\Users\exx\Desktop\RealTime_DeepCadRT\Build_Engine_File\Build_Engine_File\Source.obj 1
我在链接器上附加了以下 LIB 文件
nvinfer.lib
nvparsers.lib
nvonnxparser.lib
nvinfer_vc_plugin.lib
nvinfer_plugin.lib
nvinfer_lean.lib
nvinfer_dispatch.lib
我还有什么遗漏的吗?或者如何解决错误?
感谢您分享此内容,遇到类似问题并根据您的建议修复了