How do I add a directory to the places VisualGDB looks for .h file?

Sysprogs forums Forums VisualGDB How do I add a directory to the places VisualGDB looks for .h file?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #29451
    GeneM
    Participant

    This seems like it should be pretty straight forward but I’m still struggling.  I have a project that started from one of the STM Nucleo413ZH examples.  I did set it up in the embedded project wizard as a C++ project.   I changed main.c to main.cpp and I seem to be able to do C++ things like cout.  Now I’m trying a use the standard C++ string library and having trouble getting all the .h files included in my project. My class that needs the string library starts like this:

    #include <stm32f4xx_hal.h>

    #include <iostream>
    #include <string>
    #include <cstring>
    using namespace std;

    But I get this error when I build:  “Error bits/c++config.h: No such file or directory” and when I click on the error it shows this line in the <string> file as the culprit:

    #include <bits/c++config.h>

    I can right click on <bits/c++config.h>, hit “open file” and the file opens at:

    C:\Users\gene\AppData\Local\VisualGDB\EmbeddedBSPs\arm-eabi\com.sysprogs.arm.stm32\STM32F4xxxx\STM32F4xx_HAL_Driver\Src

    There are a whole bunch of .h files in bits that need to be included and it seems like I should be able to add the bits folder to the project properties C/C++ -> General -> Additional Include Directories or the Additional System Include Directories, but I sure haven’t figure out a way to make that work yet.

    The really confusing thing is I have a completely different project with #include <string> that worked just fine but again, I sure can’t figure out what’s different.

    Help would be appreciated.  Thanks.

     

     

     

     

     

    #29452
    GeneM
    Participant

    And I should have mentioned, I did try adding all the required header files one at a time and eventually go to memoryfwd.h which starts like this

    #ifndef _MEMORYFWD_H
    #define _MEMORYFWD_H 1

    #pragma GCC system_header

    //#include <bits/c++config.h>
    #include <c++config.h>

    namespace std _GLIBCXX_VISIBILITY(default)

    And I get this error: “unknown type ‘namespace”.  I can make a copy of memoryfwd.h and rename it memoryfwd.hpp but I need to change whatever files are including memoryfwd.h to include memoryfwd.hpp.  But I can’t find any files in my solution that have the term “memoryfwd.h”.

    There really has to be something fundamental I don’t understand.  I have several C/C++ books that I actually refer to, I’ve done a bunch of the VisualGDB tutorials and I spend a lot of time Googling for answers before I post a question.  If someone can point me at some tutorial that would help, that would be great.

    Thanks again.

     

     

    #29459
    support
    Keymaster

    Hi,

    These files should normally be a part of the toolchain and should be located automatically. If they don’t work, most likely either toolchain, or the project is corrupt.

    Please try reinstalling the toolchain via Tools->VisualGDB->Manage VisualGDB Packages. If it doesn’t help, please try reproducing the problem on a project created from scratch.

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