UsmanJafri/LiDAR-GTA-V

Redefinition conflict between "types.h" and OpenCV

niqbal996 opened this issue · 2 comments

Hi Usman,
Great work with the GTA 5 plugin. It really helped with my research for Master thesis. The plugin works perfectly for me, however, I am trying to use OpenCV with your project to add the camera images functionality.

[Problem] When I include both "types.h" file and <opencv2/opencv.hpp> for my project, I get the following error:
C2371 'uint': redefinition; different basic types

There is double conflict between
a. typedef unsigned uint in

opencv2/core/hal/interface.h

AND
b. typedef DWORD uint in

types.h

file. I tried commenting the one in types.h but 😄 then the .asi loader does not load my plugin.
ASI: Loading "D:\Applications\steamapps\common\Grand Theft Auto V\LiDAR GTA V.asi"
"LiDAR_GTA_V.asi" failed to load

It might be irrelevant to your project, But I thought you might have an idea how I could get around this problem?

I am using OpenCV3.4 , VS2017, Win SDK 8.1, GTA 5 version(1.0.1604.1).
Thank you.

Hi hitman996,

have you resolved this problem meanwhile? I'm also encountering the same problem for a similiar GTAV + scripthook project. The same issue when opencv is used

Hi @am935401 ,
Sorry for the late reply. Unfortunately, I could not find suitable way to overcome these conflicts between scripthook and standard libraries like OpenCV. If you are still stuck at this problem, I would suggest take a look at DeepGTA5 repository. It has a lot of functionalities and well written in general. Maybe that can serve as a good start. Sorry I could not give you a concrete answer. Good luck.