VS skips $include "stdafx.h"
-
Windows XP, Visual Studio 2008, MFC, Cpp Note: I am hoping that someone recognizes this basic class of problems and can advise me without additional details. If needed, tell me what additional details are required. I cannot copy/paste from my working computer so please excuse any obvious typos. Basic Problem: I added a simple stand alone function to my project and cannot get Visual Studio to compile it. Setup: Application AR2_IADS_Client_Simlulator is located in E:\VISUAL_STUDIO\AR2_IADS_Client_Simulator. This directory: E:\VISUAL_STUDIO\COMMON_CODE contains classes and code that is used by multiple solutions and projects. In the Solution Explorer, project AR2_IADS_Client_Simulator I right clicked on the Header Files part of the project and added a new dot h file named: Log_One_TCP_Packet.h. It was placed in the COMMON_CODE directory. It looks like this:
#include “stdafx.h”
#include “C_Log_Writer.h”
Void Log_One_TCP_Packet( … arguments );The same was done in section Source Files and file Log_One_TCP_Packet.h.cpp was also created in COMMON_CODE. It begins like this:
#include “stdafx.h”
#include “Log_One_TCP_Packet.h”
Void Log_One_TCP_Packet( … arguments )
{ … }Action: The cpp file is open in VS and is in focus. Press ctl-F7 to compile it. The error messages state:
Quote:
Warning C4627 #include “stdafx.h” skipped when looking for precompiled header use. Warning C4627 #include “Log_One_TCP_Packet.h” skipped when looking for precompiled header use. Fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add ‘#include “stdafx.h”’ to your soruce?
I don’t know of any option such as: #include_and_do_not_skip “Log_One_TCP_Packet.h” There is no button I can select that says: “No! I did not forget. Its right there in the source code.” There are already several classes in COMMON_CODE used by this project. The directory is referenced in
Quote:
Properties -> Configuration Properties -> C/C++ -> Additional Include Directories.
Questions Must this function be made into a stand-alone class just for this one function? How might I get VS to recognize and compile it?
Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com
-
Windows XP, Visual Studio 2008, MFC, Cpp Note: I am hoping that someone recognizes this basic class of problems and can advise me without additional details. If needed, tell me what additional details are required. I cannot copy/paste from my working computer so please excuse any obvious typos. Basic Problem: I added a simple stand alone function to my project and cannot get Visual Studio to compile it. Setup: Application AR2_IADS_Client_Simlulator is located in E:\VISUAL_STUDIO\AR2_IADS_Client_Simulator. This directory: E:\VISUAL_STUDIO\COMMON_CODE contains classes and code that is used by multiple solutions and projects. In the Solution Explorer, project AR2_IADS_Client_Simulator I right clicked on the Header Files part of the project and added a new dot h file named: Log_One_TCP_Packet.h. It was placed in the COMMON_CODE directory. It looks like this:
#include “stdafx.h”
#include “C_Log_Writer.h”
Void Log_One_TCP_Packet( … arguments );The same was done in section Source Files and file Log_One_TCP_Packet.h.cpp was also created in COMMON_CODE. It begins like this:
#include “stdafx.h”
#include “Log_One_TCP_Packet.h”
Void Log_One_TCP_Packet( … arguments )
{ … }Action: The cpp file is open in VS and is in focus. Press ctl-F7 to compile it. The error messages state:
Quote:
Warning C4627 #include “stdafx.h” skipped when looking for precompiled header use. Warning C4627 #include “Log_One_TCP_Packet.h” skipped when looking for precompiled header use. Fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add ‘#include “stdafx.h”’ to your soruce?
I don’t know of any option such as: #include_and_do_not_skip “Log_One_TCP_Packet.h” There is no button I can select that says: “No! I did not forget. Its right there in the source code.” There are already several classes in COMMON_CODE used by this project. The directory is referenced in
Quote:
Properties -> Configuration Properties -> C/C++ -> Additional Include Directories.
Questions Must this function be made into a stand-alone class just for this one function? How might I get VS to recognize and compile it?
Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com
Did you try cleaning and rebuilding the whole project?
The difficult we do right away... ...the impossible takes slightly longer.
-
Did you try cleaning and rebuilding the whole project?
The difficult we do right away... ...the impossible takes slightly longer.
Rats. Its so easy to forget the easy stuff. No, I did not. I will try that at work tomorrow. But I did make a class out of it and that worked just fine.
Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com
-
Windows XP, Visual Studio 2008, MFC, Cpp Note: I am hoping that someone recognizes this basic class of problems and can advise me without additional details. If needed, tell me what additional details are required. I cannot copy/paste from my working computer so please excuse any obvious typos. Basic Problem: I added a simple stand alone function to my project and cannot get Visual Studio to compile it. Setup: Application AR2_IADS_Client_Simlulator is located in E:\VISUAL_STUDIO\AR2_IADS_Client_Simulator. This directory: E:\VISUAL_STUDIO\COMMON_CODE contains classes and code that is used by multiple solutions and projects. In the Solution Explorer, project AR2_IADS_Client_Simulator I right clicked on the Header Files part of the project and added a new dot h file named: Log_One_TCP_Packet.h. It was placed in the COMMON_CODE directory. It looks like this:
#include “stdafx.h”
#include “C_Log_Writer.h”
Void Log_One_TCP_Packet( … arguments );The same was done in section Source Files and file Log_One_TCP_Packet.h.cpp was also created in COMMON_CODE. It begins like this:
#include “stdafx.h”
#include “Log_One_TCP_Packet.h”
Void Log_One_TCP_Packet( … arguments )
{ … }Action: The cpp file is open in VS and is in focus. Press ctl-F7 to compile it. The error messages state:
Quote:
Warning C4627 #include “stdafx.h” skipped when looking for precompiled header use. Warning C4627 #include “Log_One_TCP_Packet.h” skipped when looking for precompiled header use. Fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add ‘#include “stdafx.h”’ to your soruce?
I don’t know of any option such as: #include_and_do_not_skip “Log_One_TCP_Packet.h” There is no button I can select that says: “No! I did not forget. Its right there in the source code.” There are already several classes in COMMON_CODE used by this project. The directory is referenced in
Quote:
Properties -> Configuration Properties -> C/C++ -> Additional Include Directories.
Questions Must this function be made into a stand-alone class just for this one function? How might I get VS to recognize and compile it?
Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com