Visual C++ project physical directory [solved]
-
I want to make a directory structure for my project, like: project1\header \source \Lib \resource etc.. On my disk, I created the folders. but I don't know how to import the structure to my visual studio virtual groups. I mean, when I moved .h files to \header folder, visual studio could not found .h files then. Is there a method to let visual studio work with physical directory structures?
-
Yes it is possible but once you have the files in place you then need to add them to the project in Solution Explorer, from their source locations.
Use the best guess
I tried, but the .cpp files can't find .h files. #include "stdafx.h" for example, even I changed it to: #include "Header/stdafx.h" IDE gives: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
-
I tried, but the .cpp files can't find .h files. #include "stdafx.h" for example, even I changed it to: #include "Header/stdafx.h" IDE gives: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
- Do a Clean of your project and delete all the Debug and Release folders.
- Make sure that you have added all the files into the project correctly.
- Check that all
#include
statements have the correct path prefix where necessary. - Rebuild the project and correct any errors.
- Repeat as necessary.
Use the best guess
-
- Do a Clean of your project and delete all the Debug and Release folders.
- Make sure that you have added all the files into the project correctly.
- Check that all
#include
statements have the correct path prefix where necessary. - Rebuild the project and correct any errors.
- Repeat as necessary.
Use the best guess
I changed the project directory structure like the following: project1\Header\StdAfx.h project1\Source\StdAfx.cpp project1\project1.vcproj; project1.sln Now I got error message: fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? In StdAfx.cpp, only one statement: #include "..\Header\stdafx.h" Could you give me some tip?
-
I changed the project directory structure like the following: project1\Header\StdAfx.h project1\Source\StdAfx.cpp project1\project1.vcproj; project1.sln Now I got error message: fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? In StdAfx.cpp, only one statement: #include "..\Header\stdafx.h" Could you give me some tip?
Hre's a tip. Try pasting that error message into Google. It's very easy to fix.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Hre's a tip. Try pasting that error message into Google. It's very easy to fix.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Bullshit. You're going to do some work for this one. Do what I told you and the very first link will solve it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
I changed the project directory structure like the following: project1\Header\StdAfx.h project1\Source\StdAfx.cpp project1\project1.vcproj; project1.sln Now I got error message: fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? In StdAfx.cpp, only one statement: #include "..\Header\stdafx.h" Could you give me some tip?
I already told you what to do in my previous response. However, given the fact that you do not really seem to understand how this works, I would suggest you forget this idea and stick with the standard project structure as created by Visual Studio.
Use the best guess
-
I already told you what to do in my previous response. However, given the fact that you do not really seem to understand how this works, I would suggest you forget this idea and stick with the standard project structure as created by Visual Studio.
Use the best guess
I understand your previous post. and I created a test project, sure, it works. But, the project I am working with, it seems remove old, add new location, clean, IDE still give error messages. This is a WinCE template project, supplied by one company, will ask them how to solve it. Thank you for your help
-
I understand your previous post. and I created a test project, sure, it works. But, the project I am working with, it seems remove old, add new location, clean, IDE still give error messages. This is a WinCE template project, supplied by one company, will ask them how to solve it. Thank you for your help
The error message indicates that the project has not been cleaned properly, as Visual Studio thinks that there should be a precompiled header somewhere. Clean and rebuild should fix this. Since this project is not your own it would make more sense to leave it as is.
Use the best guess