Initialize TfNeuralClassifier after creation with config including fps parameter
User
clangd undiclared nvinfer1
Assistant
The error "clangd: undeclared identifier 'nvinfer1'" usually means that the compiler (or clangd language server) cannot find the declaration of the nvinfer1 namespace, which belongs to NVIDIA TensorRT SDK. This typically happens because the TensorRT headers are not properly included or the include paths are not set correctly in your project.
Here are some steps to fix this:
Include the correct header:
Make sure you have the following include in your source file:
#include <NvInfer.h>
This header defines the namespace.
User
find tensorrt inclide path docker ubuntu
Assistant
To find the TensorRT include path inside a Docker container running Ubuntu, follow these steps:
Step 1: Check if TensorRT is installed inside the container
TensorRT headers (like NvInfer.h) are usually located under /usr/include/x86_64-linux-gnu/ or under if installed system-wide.
nvinfer1
Configure your include path:
Make sure your build system or your editor can find the TensorRT include directory. For example, if you installed TensorRT in /usr/local/TensorRT, you might need to add:
-I/usr/local/TensorRT/include
to your compiler flags or your clangd configuration.
If using compile_commands.json:
Make sure your compile_commands.json contains the proper include paths for TensorRT headers so clangd can pick them up.
If after this clangd still doesn't detect nvinfer1, but your build succeeds, it's likely your editor or clangd is missing include paths. You may need to configure .clangd, .vim/coc-settings.json, your VSCode settings, or regenerate compile_commands.json so clangd knows where to look.
If you want, provide your build setup or how you invoke clangd, I can help write the necessary config.