Cannot open include file with Visual Studio

后端 未结 8 1913
遥遥无期
遥遥无期 2020-12-30 22:26

I have recently gone from Code::Blocks to Visual Studio, and in Code::Blocks one could just add a class and then include it straight away. However, whenever I do the same in

相关标签:
8条回答
  • 2020-12-30 23:13

    Go to your Project properties (Project -> Properties -> Configuration Properties -> C/C++ -> General) and in the field Additional Include Directories add the path to your .h file.

    And be sure that your Configuration and Platform are the active ones. Example: Configuration: Active(Debug) Platform: Active(Win32).

    0 讨论(0)
  • 2020-12-30 23:14

    I had this same issue going from e.g gcc to visual studio for C programming. Make sure your include file is actually in the directory -- not just shown in the VS project tree. For me in other languages copying into a folder in the project tree would indeed move the file in. With Visual Studio 2010, pasting into "Header Files" was NOT putting the .h file there.

    Please check your actual directory for the presence of the include file. Putting it into the "header files" folder in project/solution explorer was not enough.

    0 讨论(0)
提交回复
热议问题