Error Cannot Open Source File .h
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Visual Studio 2012 Error: Cannot open source file up vote 0 down vote favorite I have source code (header and source files)of a library. I need to include the source code in my existing project. For that purpose i have copied the entire library source code directory into visual studio project folder then i included that directory to VS by using include to project option. Fine. There is a header file say "x.h" in the library source code directory which defines some macros, and there are some other header files say "y.h" and "z.h" which are using those macros defined in "x.h". But visual studio is not recognising those macros at all when i included those ("y.h" and "z.h") header files in my main class. Visual Studio generates the error "Cannot open this source file". Actually "y.h" and "z.h" can not find macros defined in "x.h". How to solve this error? Is there some kind of setting need in the project properties? My second question is that how to include some programming files in my project correctly so that i can use that library functionality correctly? I have also Include the header directories in configuration properties > VC++ Diectories > Include Directories. Third question is that is there a way in which i don't have to include the sour
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Cannot open include file, with http://stackoverflow.com/questions/27567311/visual-studio-2012-error-cannot-open-source-file visual studio up vote 5 down vote favorite I have recently gone from codeblocks to Visual Studio, and in codeBlocks one could just add a class and then include it straight away. However, whenever I do the same in Visual Vtudio with the following statement: #include "includedFile.h" or #include "include/includedFile.h" It doesn't work and instead I get the error: cannot open include file: 'includedFile.h'; no such http://stackoverflow.com/questions/19415521/cannot-open-include-file-with-visual-studio file or directory. Is there some box or setting that I have to tick? Or do I have to add each header as a dependency manually? Here is the code for the class in question: Public.h: #pragma once class Public { public: static const int SCREEN_WIDTH=1000; static const int SCREEN_HEIGHT=1250; Public(void); ~Public(void); }; Public.cpp: #include "Public.h" Public::Public(void) { } Public::~Public(void) { } How it is being included: #include "Public.h" c++ visual-studio visual-studio-2012 include codeblocks share|improve this question edited Oct 19 '13 at 0:06 chappjc 25.4k64366 asked Oct 16 '13 at 23:08 user2853108 3733513 see this comment stackoverflow.com/a/31730081/185022 it should be marked as correct solution –AZ_ 2 hours ago add a comment| 6 Answers 6 active oldest votes up vote 12 down vote By default, Visual Studio searches for headers in the folder where your project is ($ProjectDir) and in the default standard libraries directories. If you need to include something that is not placed in your project directory, you need to add the path to the folder to include: Go to your Project properties (Project -> Properties -> Configuration Properties -> C/C++ -> General) and in the field Additional Include Directories add t
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies http://stackoverflow.com/questions/7623980/intellisense-cannot-open-source-file-curl-h-in-c of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges https://msdn.microsoft.com/en-us/library/et4zwx34.aspx Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: error cannot Sign up IntelliSense: cannot open source file “curl.h” in C++ up vote 2 down vote favorite 1 I am unable to compile my C++ project. IntelliSense: cannot open source file "curl.h" in C++ I tried adding that file to the "Header Files" folder in Solution Explorer: no change. I was unable to add it to the "Source Files" folder. How can I fix error cannot open this? c++ compiler-errors resource-files share|improve this question edited Oct 2 '11 at 22:29 bzlm 6,87034272 asked Oct 2 '11 at 1:08 user975017 23113 How are you including it in your source files/headers? –Amy Oct 2 '11 at 1:20 add a comment| 4 Answers 4 active oldest votes up vote 11 down vote Right click on your project select Properties Expand Configuration Properties Click on the VC++ Directories Add $(ProjectDir) into the "Reference Directories" item share|improve this answer answered Jun 30 '13 at 20:34 Jason Newland 16713 2 This, in most cases will fix intellisense errors for all header files –Jason Newland Jun 30 '13 at 20:35 It worked. Thanks! –deepdive Aug 26 '13 at 8:44 add a comment| up vote 5 down vote Under Visual Studio 2010/2012/2013 Right click on your project select Properties Expand Configuration Properties Click on the VC++ Directories Add the path to your file, as well as $(ProjectDir), into the "Reference Directories" item share|improve this answer edited Jan 28 '14 at 14:21 answered Oct 18 '11 at 2:13 Noah 9,674776134 1 Also works in Visua
resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9 Documentation APIs and reference Dev centers Retired content Samples We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. C/C++ Building Reference C/C++ Build Errors Compiler Fatal Errors C999 through C1999 Compiler Fatal Errors C999 through C1999 Fatal Error C1083 Fatal Error C1083 Fatal Error C1083 Fatal Error C999 Fatal Error C1001 Fatal Error C1002 Fatal Error C1003 Fatal Error C1004 Fatal Error C1005 Fatal Error C1007 Fatal Error C1008 Fatal Error C1009 Fatal Error C1010 Fatal Error C1012 Fatal Error C1013 Fatal Error C1014 Fatal Error C1016 Fatal Error C1017 Fatal Error C1018 Fatal Error C1019 Fatal Error C1020 Fatal Error C1021 Fatal Error C1022 Fatal Error C1023 Fatal Error C1026 Fatal Error C1033 Fatal Error C1035 Fatal Error C1037 Fatal Error C1038 Fatal Error C1045 Fatal Error C1046 Fatal Error C1047 Fatal Error C1051 Fatal Error C1053 Fatal Error C1054 Fatal Error C1055 Fatal Error C1057 Fatal Error C1060 Fatal Error C1061 Fatal Error C1064 Fatal Error C1065 Fatal Error C1067 Fatal Error C1068 Fatal Error C1070 Fatal Error C1071 Fatal Error C1073 Fatal Error C1074 Fatal Error C1075 Fatal Error C1076 Fatal Error C1077 Fatal Error C1079 Fatal Error C1080 Fatal Error C1081 Fatal Error C1082 Fatal Error C1083 Fatal Error C1084 Fatal Error C1085 Fatal Error C1086 Fatal Error C1087 Fatal Error C1088 Fatal Error C1089 Fatal Error C1091 Fatal Error C1092 Fatal Error C1093 Fatal Error C1094 Fatal Error C1098 Fatal Error C1099 Fatal Error C1100 Fatal Error C1103 Fatal Error C1104 Fatal Error C1107 Fatal Error C1108 Fatal Error C1109 Fatal Error C1113 Fatal Error C1120 Fatal Error C1121 Fatal Error C1126 Fatal Error C1128 Fatal Error C1189 Fatal Error C1190 Fatal Error C1191 Fatal Error C1192 Fatal Error C1196 Fatal Error C1197 Fatal Error C1201 Fatal Error C1202 Fatal Error C1205 Fatal Error C1206 Fatal Error C1207 Fatal Error C1208 Fatal Error C1209 Fatal Error C1210 Fatal Error C1211 Fatal Error C1305 Fatal Error C1307 Fatal Error C1308 Fatal Error C1309 Fatal Error C1310 Fatal Error C1311 Fatal Error C1312 Fatal Error C1313 Fatal Error C1350 Fatal Error C1351 Fatal Error C1352 Fatal Error C1353 Fatal Error C1382 Fatal Error C1383 Fatal Error C1