Skip to main content
Associate III
September 3, 2024
Solved

not found when included in a .h file

  • September 3, 2024
  • 1 reply
  • 985 views

Hi,

I need to use <string> (standard in C++ libraries and am working in a C++ project. My header file is a normal .h, and on compiling I get the below. Oddly, if I select string in the header and view declaration, the standard file opens up just fine?

Any ideas people?

mtechmatt_0-1725368189958.png

 

    Best answer by TDK

    You cannot include C++ headers from a C file.

    TDK_0-1725369381993.png

    You will have to rework the project so this only gets included from within *.cpp files.

    1 reply

    TDK
    TDKBest answer
    Super User
    September 3, 2024

    You cannot include C++ headers from a C file.

    TDK_0-1725369381993.png

    You will have to rework the project so this only gets included from within *.cpp files.

    "If you feel a post has answered your question, please click ""Accept as Solution""."