Smorodov / Multitarget-tracker

Multiple Object Tracker, Based on Hungarian algorithm + Kalman filter.
Apache License 2.0
2.17k stars 649 forks source link

There are some errors when building the project. #413

Closed sunsunnyshine closed 1 year ago

sunsunnyshine commented 1 year ago

Hi! sorry for bothering you again. I saw the code is updated 4weeks ago.I download the newest code and use CMake and VS2022. error occured.I will be appreciated if you could give me some suggestions. image

Nuzhny007 commented 1 year ago

Do you can show me a line from Output window with this error? In they will be more information about context

sunsunnyshine commented 1 year ago

I think that error occurs when building the yolo_rt_lib project.These are the output:

Build started... 1>------ Build started: Project: yolo_rt_lib, Configuration: Debug x64 ------ 1>Building NVCC (Device) object src/Detector/tensorrt_yolo/CMakeFiles/yolo_rt_lib.dir/Debug/yolo_rt_lib_generated_decodeTensorCUDA.cu.obj 1>decodeTensorCUDA.cu 1>D:\code\Vscode\Multitarget-tracker-master-new\src\Detector\tensorrt_yolo\decodeTensorCUDA.cu(1): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss 1>D:\third library\TensorRT-8.5.1.7\include\NvInfer.h(6102): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss 1>D:\code\Vscode\Multitarget-tracker-master-new\src\Detector\tensorrt_yolo\decodeTensorCUDA.cu(1): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss 1>D:\third library\TensorRT-8.5.1.7\include\NvInfer.h(6102): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss 1>D:\code\Vscode\Multitarget-tracker-master-new\src\Detector\tensorrt_yolo\decodeTensorCUDA.cu(1): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss 1>D:\third library\TensorRT-8.5.1.7\include\NvInfer.h(6102): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss 1>D:\third library\opencv\opencv-4.5.5\include\opencv2/stitching/detail/warpers.hpp(235): warning #611-D: overloaded virtual function "cv::detail::PlaneWarper::buildMaps" is only partially overridden in class "cv::detail::AffineWarper" 1> 1>D:\third library\opencv\opencv-4.5.5\include\opencv2/stitching/detail/warpers.hpp(235): warning #611-D: overloaded virtual function "cv::detail::PlaneWarper::warp" is only partially overridden in class "cv::detail::AffineWarper" 1> 1>D:\third library\opencv\opencv-4.5.5\include\opencv2/stitching/detail/blenders.hpp(100): warning #611-D: overloaded virtual function "cv::detail::Blender::prepare" is only partially overridden in class "cv::detail::FeatherBlender" 1> 1>D:\third library\opencv\opencv-4.5.5\include\opencv2/stitching/detail/blenders.hpp(127): warning #611-D: overloaded virtual function "cv::detail::Blender::prepare" is only partially overridden in class "cv::detail::MultiBandBlender" 1> 1>D:\code\Vscode\Multitarget-tracker-master-new\src\Detector\tensorrt_yolo\decodeTensorCUDA.cu(62): error : identifier "detections" is undefined 1> 1>1 error detected in the compilation of "D:/code/Vscode/Multitarget-tracker-master-new/src/Detector/tensorrt_yolo/decodeTensorCUDA.cu". 1>decodeTensorCUDA.cu 1>CMake Error at yolo_rt_lib_generated_decodeTensorCUDA.cu.obj.Debug.cmake:280 (message): 1> Error generating file 1> D:/code/Vscode/Multitarget-tracker-master-new/build/src/Detector/tensorrt_yolo/CMakeFiles/yolo_rt_lib.dir//Debug/yolo_rt_lib_generated_decodeTensorCUDA.cu.obj 1> 1> 1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB8066: Custom build for 'D:\code\Vscode\Multitarget-tracker-master-new\src\Detector\tensorrt_yolo\decodeTensorCUDA.cu;D:\code\Vscode\Multitarget-tracker-master-new\src\Detector\tensorrt_yolo\detect.cu;D:\code\Vscode\Multitarget-tracker-master-new\src\Detector\tensorrt_yolo\hardswish.cu;D:\code\Vscode\Multitarget-tracker-master-new\src\Detector\tensorrt_yolo\kernel.cu;D:\code\Vscode\Multitarget-tracker-master-new\src\Detector\tensorrt_yolo\mish.cu;D:\code\Vscode\Multitarget-tracker-master-new\build\CMakeFiles\df38e1db80bfbe079749749b002341eb\yolo_rt_lib_intermediate_link.obj.rule' exited with code 1. 1>Done building project "yolo_rt_lib.vcxproj" -- FAILED. 2>------ Build started: Project: MultitargetTracker, Configuration: Debug x64 ------ 2>LINK : fatal error LNK1104: cannot open file '..\Debug\yolo_rt_lib.lib' 2>Done building project "MultitargetTracker.vcxproj" -- FAILED. 3>------ Skipped Build: Project: INSTALL, Configuration: Debug x64 ------ 3>Project not selected to build for this solution configuration ========== Build: 0 succeeded, 2 failed, 5 up-to-date, 1 skipped ========== ========== Elapsed 00:06.409 ==========

I'll be sincerely appreciated if you could give me an advise.

Nuzhny007 commented 1 year ago

Error is here: 1>D:\code\Vscode\Multitarget-tracker-master-new\src\Detector\tensorrt_yolo\decodeTensorCUDA.cu(62): error : identifier "detections" is undefined

But in 62 line is variable "detection" absent: https://github.com/Smorodov/Multitarget-tracker/blob/master/src/Detector/tensorrt_yolo/decodeTensorCUDA.cu#L62

It was defined in 51 line and used in 63 line. Are you sure than your version of code is the same?

sunsunnyshine commented 1 year ago

yes,i'm confused too.there is no "detections" in 62 line. I've tried again.download the whole code repository and cmake again. The same error occurs.

sunsunnyshine commented 1 year ago

I ask the chatGPT ,here are some Possible causes.

1.If you encounter an error in Visual Studio while building a CMake-generated project, stating that an identifier "detections" is undefined, but you cannot locate the "detections" identifier in the specific line mentioned in the error message, here are some steps you can take to troubleshoot and resolve the issue: 2.Double-check your code: Verify that you have correctly defined the "detections" identifier in your code. Make sure it is spelled correctly and declared or included where it is being used. It's possible that the error is caused by a typo or missing declaration in your code. 3.Check your CMakeLists.txt file: The error could also be related to how CMake is generating the project. Make sure that the relevant source files containing the "detections" identifier are properly included in your CMakeLists.txt file. Check for any errors or omissions in the CMakeLists.txt file that could be causing the issue. 4.Verify your build configuration: Ensure that you have selected the correct build configuration in Visual Studio. It's possible that the "detections" identifier is defined in a conditional compilation block or is part of a specific build configuration, which is not currently selected, causing the error. 5.Clean and rebuild: Try cleaning your project and then rebuilding it. Sometimes, stale build artifacts or intermediate files can cause issues, and a clean rebuild can help resolve them. 6.Check for conflicting definitions: If you are using multiple libraries or source files that could potentially have conflicting definitions of the "detections" identifier, check for any conflicts and resolve them appropriately. Make sure that there are no conflicting declarations or definitions of "detections" in your project. 7.Verify dependencies: If "detections" is defined in a separate library or module that is used by your project, make sure that the library or module is properly included in your project and that it is being linked correctly during the build process. 8.Update CMake and Visual Studio: Make sure that you are using the latest versions of CMake and Visual Studio, as older versions may have known issues that could cause the error. If you have tried the above steps and the issue persists, you may need to consult the documentation, seek help from online forums, or reach out to the CMake or Visual Studio community for further assistance in resolving the issue.

I noticed that detections init as const float in 51 line,but be cast explicitly to void,does this matter? If not,I consider to update my CMake(3.24.3) version and try again. Thank u~

Nuzhny007 commented 1 year ago

I have no idea. I'm using also MSVS 2022 on 2 windows laptops and project build and run correctly. But I generate first a solution (+ projects) with CMake and after open it with MSVS

sunsunnyshine commented 1 year ago

I'm so sorry for wasting your time! I've figured out that i uncorrectly use D:/third library/TensorRT-8.5.1.7/lib/nvinfer.lib not D:/third library/TensorRT-8.5.1.7/lib/*.lib! I don't know when I make such a bad change...