Sourcetrail icon indicating copy to clipboard operation
Sourcetrail copied to clipboard

unknown type name ''int32_t'' on Windows machine

Open amat27 opened this issue 4 years ago • 6 comments

I'm adding source group as empty c++ source group

Tried following options:

  • #include <stdint.h> in header
  • use --include=stdint.h in compiler flags (and this .h file can be found by LLVM in sourcetrail)
  • -fms-extensions -fms-compatibility -fms-compatibility-version=19
  • --driver-mode=cl

amat27 avatar Feb 22 '21 03:02 amat27

This is strange. I cannot reproduce the issue, it works for me. Which C++ compiler do you have installed?

By the way, these two options are the same:

  • #include <stdint.h> in header
  • use --include=stdint.h in compiler flags (and this .h file can be found by LLVM in sourcetrail)

mlangkabel avatar Feb 22 '21 17:02 mlangkabel

My C++ project uses MSVC. I have VS 2017 and 2019 installed.

By the way, these two options are the same...

Thanks. I'm just blindly trying every possibility.

amat27 avatar Feb 23 '21 01:02 amat27

Do you have added the directory path that contains stdint.h to your header search paths? In your Sourcetrail project that option is called "Include Paths" or "Global Include Paths" if it shall be used for all your C/C++ projects. Actually there should be an auto-detection for those "Global Include Paths", but I think we have broken it with the 2020.4 release. It is already fixed for the next version, but until that one is release, you could try to use the 2020.2 version.

mlangkabel avatar Feb 23 '21 16:02 mlangkabel

Thanks for the suggestion. I have the VCTools and WinSDK dir in my include paths. And actually I think sourcetrail found this h as included file, otherwise --include=stdint.h will throw an error like "included find not found".

I also tried 2020.2.43 on the same project, gave me the same error.

amat27 avatar Feb 24 '21 04:02 amat27

Sounds like the issue is related to #include_next. So maybe the order of your header search paths is wrong. Try to clear the Global Include Paths in Sourcetrail 2020.2 and re-run the detection: image

mlangkabel avatar Feb 24 '21 07:02 mlangkabel

Still seeing the same error. The detected result is like:

C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/include
C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/atlmfc/include
C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/VS/include
C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/VS/UnitTest/include
C:/Program Files (x86)/Windows Kits/8.1/include/shared
C:/Program Files (x86)/Windows Kits/8.1/include/um
C:/Program Files (x86)/Windows Kits/8.1/include/winrt
C:/Program Files (x86)/Windows Kits/10/include/10.0.10240.0/ucrt

Could you please elaborate on "the order of your header search paths is wrong"? How can I detect that? Because I also add SDK/VCTools search paths in include path (as we use nuget package to distribute the vcredist files)

amat27 avatar Feb 24 '21 08:02 amat27