VS2019 Raspberry Pi 'type' does not name a type

Sysprogs forums Forums VisualGDB VS2019 Raspberry Pi 'type' does not name a type

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26948
    David
    Participant

    Hi,

    I have recently started to use VisualGDB on a Raspberry PI 4 and am having problems. I have downloaded the latest Raspbian Buster SD as linked through VisualGDB and updated to V5.5 Preview 2 build 3410. The Raspberry Pi tool chain is the same on both Pi and Windows (g++ (Raspbian 8.3.0-6+rpi1) 8.3.0 & arm-linux-gnueabihf-g++ (Raspbian 8.3.0-6+rpi1) 8.3.0). I am using Visual Studio 2019.

    On creation of the project I get build errors of this nature:

    ‘__int8_least8_t’ does not name a type…. (more like this for other types)

    ‘::int_least8_t’ has not bean declared (more like this for other types)

    conflicting declaration ‘typedef struct cpu_set_t cpu_set_t’ (more like this)

    If I compile the same simple “Hello World” program (copy and paste) directly on the Pi it compiles and runs. If I try cross compiling on windows using a command prompt and the simple cpp file and “arm-linux-gnueabihf-g++ Test.cpp” I get the above errors.

    I created an include file that fixed these errors (along with some small mods to some header files) and got the simple “Hello World” program to compile, run and debug. When I then tried to extend my program I started to get more errors to the point that I couldn’t keep chasing my tail.

    Is there some simple setting that I am missing or is there a problem with the tool chain?

    Cheers
    David

    Attachments:
    You must be logged in to view attached files.
    #26950
    support
    Keymaster

    Hi,

    This looks like a corrupt toolchain. Unfortunately, as you have cropped the screenshot, it’s hard to tell whether it’s an IntelliSense-only issue, or a full-scale toolchain corruption (see this page for best error reporting practices). Either way, the easiest way to solve this would be to delete the entire Raspberry Pi toolchain, reinstall the one compatible with your SD card image (see the full list here), and verify that newly created projects build after reinstalling the toolchain.

    If the projects stop building after you resynchronize the toolchain’s sysroot, your SD card image is likely incompatible with the toolchain. If this is the case, simply start with a fresh compatible image from the list and you should be able to build the projects.

    #26952
    David
    Participant

    Thank you, it is now working.

    I did as suggested and

    • removed the current C:\sysgcc\raspberry directory
    • downloaded the latest full SD card and toolchain from your website
    • flashed the SD card
    • installed the toolchain
    • synchronised sysroot (from SD card without doing any updates or upgrades)
    • created a new project
    • compiled and it worked!

    I think I had updated from GCC 6.3.0 to GCC 8.3.0. Whether this caused the problem I don’t know. I had synchronised sysroot with the “Re-download all files” option but this didn’t work.

    Thanks again for your guidance.

    #26953
    support
    Keymaster

    Good to know it works. Most likely, you have initially upgraded the toolchain, but not the SD card image (or the other way) and synchronized an incompatible SD card image with a toolchain that expected different versions of the headers/libraries. Either way, the procedure you described is the correct way of resetting the toolchain, so it should now work as expected.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.