cancel
Showing results for 
Search instead for 
Did you mean: 

<string> not found when included in a .h file

mtechmatt
Associate II

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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".

View solution in original post

1 REPLY 1
TDK
Guru

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".