Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error LNK2019: "class nvinfer1::IRuntime" win10 cmake failure of TensorRT 8.6 #3833

Open
HorseJson opened this issue Apr 28, 2024 · 3 comments
Labels
triaged Issue has been triaged by maintainers

Comments

@HorseJson
Copy link

HorseJson commented Apr 28, 2024

cmake sampleEngines.cpp,ERROR“[build] sampleEngines.obj : error LNK2019: 无法解析的外部符号 "class nvinfer1::IRuntime * __cdecl createRuntime(void)" (?createRuntime@@YAPEAVIRuntime@nvinfer1@@xz),函数 "public: class nvinfer1::ICudaEngine * __cdecl sample::LazilyDeserializedEngine::get(void)" (?get@LazilyDeserializedEngine@sample@@QEAAPEAVICudaEngine@nvinfer1@@xz) 中引用了该符号 [D:\00DaittoCode\TensorRTOfficial\release_10.0\engine\build\TRT.vcxproj]”

Sure add nvinfer.lib successfully

@HorseJson HorseJson changed the title win10 cmake failure of TensorRT 8.6 error LNK2019 class nvinfer1::IRuntime win10 cmake failure of TensorRT 8.6 Apr 28, 2024
@HorseJson HorseJson changed the title error LNK2019 class nvinfer1::IRuntime win10 cmake failure of TensorRT 8.6 error LNK2019: "class nvinfer1::IRuntime" win10 cmake failure of TensorRT 8.6 Apr 28, 2024
@lix19937
Copy link

lix19937 commented Apr 29, 2024

make sure ld lib path , ld lib name right.

@HorseJson
Copy link
Author

HorseJson commented Apr 30, 2024

Thanks for your help, the problem is solved.
add_executable(TRT
samples/common/logger.cpp
samples/common/sampleEngines.cpp
samples/common/sampleInference.cpp
samples/common/sampleOptions.cpp
samples/common/sampleReporting.cpp
samples/common/sampleUtils.cpp
) will error LNK2019: unresolved external symbol "class nvinfer1::IBuilder * __cdecl createBuilder(void)" and so on.
add_executable(TRT
samples/common/logger.cpp
samples/common/sampleEngines.cpp
samples/common/sampleInference.cpp
samples/common/sampleOptions.cpp
samples/common/sampleReporting.cpp
samples/common/sampleUtils.cpp
samples/trtexec/trtexec.cpp
) There will no be error.

@zerollzeng zerollzeng added the triaged Issue has been triaged by maintainers label May 3, 2024
@zerollzeng
Copy link
Collaborator

I'm closing this as the problem is solved, feel free to reopen if you have any further questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issue has been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

3 participants