76 questions
0
votes
0
answers
1k
views
Building a C++ Visual Studio project in another IDE: fatal error afxwin.h
I downloaded this project's files which is written in visual studio and I am trying to make it compile in Code Blocks. The issue I am having, is with the StdAfx.h/.c files, which if I understand this ...
1
vote
1
answer
2k
views
E1696 cannot open source file "stdafx.h" during compilation
I have two projects A and B. In project A, I have created a source file called Logger.cpp where I have #include "stdafx.h" in the includes part. The stdafx.h is present in the project A. In ...
0
votes
1
answer
67
views
Is there something wrong with how I've created this class?
I keep getting an error with the cpp that asks if I forgot to include stdafx.h, which I have done in the header, the error code is C1010.
The full error reads: unexpected end of file while looking ...
0
votes
1
answer
10k
views
How to fix Error Code E1696? In Windows Visual Studio 2019
So I recently downloaded Windows Visual Studio 2019. I haven't programmed in a while and I wanted to refresh myself with a basic "hello world" program. But for some reason I'm getting an error with my ...
0
votes
0
answers
1k
views
stdafx.h: fatal error: afxwin.h: No such file or directory (Works for 2018 VS community but not VS code)
I read up on a lot on this issue from other posts but I cant find anything specific to my situation.
I have a large project in C++ that complies successfully in VS 2017 community. I am wrapping the ...
0
votes
1
answer
517
views
Visual Studio C++ console application [duplicate]
I recently had to reinstall visual studio. Previously when I chose Windows Console Application it would load with #include "stdafx.h". Now for some reason it loads with #include "pch.h" and a "hello ...
0
votes
0
answers
2k
views
Adding vld.h header file of Visual Leak Detector in source code for memory leak
I am trying to use Visual Leak Detector in my C++ application (using visual studio 2013), and after reading the documentation and modifying Include Directories and Library Directories of a project, I ...
2
votes
0
answers
172
views
Nifty counter in precompiled header does not work
To fix a problem caused by the static (de-)initialization order fiasco I tried to use the Nifty Counter idiom aka Schwartz Counter. I noticed, however, that it does not work if the header file ...
-3
votes
2
answers
1k
views
How to avoid stdafx and other header files [closed]
When creating a new C++ Windows Application in Visual Studio 2017, I am always given an stdafx.cpp file, as well as stdafx.h and targetver.h files. I am taking an Intro Programming class and the ...
-2
votes
2
answers
2k
views
Why isn't include stdafx.h not enough for VisualStudio?
I understand that the purpose of precompiled header is about to speed up compilation process by using object file that was already compiled once and link it to actual project. But what I do not ...
1
vote
1
answer
2k
views
Namespace declared in Header file is not being recognized in Source File [duplicate]
What am i doing wrong here?
APP.h
#pragma once
namespace App{
enum class AppStatus{
Exit,
Menu,
Run
};
void frameLoop();
AppStatus state;
}
App.cpp
#include "App.h"
...
0
votes
1
answer
2k
views
Error C1083: Cannot open include file: 'stdafx.h', but it should?
#include <stdafx.h>
i checked error C1083: Cannot open include file: 'stdafx.h': No such file or directory in VS 2005
but it still didn't help. im using precompiled headers. Usually i ...
0
votes
1
answer
199
views
Include issue with XLL plus
Trying to create and run a new XLL+ project. When the project gets created. No error, however, if I turn the Active Solution Platform to x64 in Visual Studio 2015, I get the following error:
Error ...
0
votes
1
answer
2k
views
afxwin.h issues in Visual Studio 2015 Windows Form App
A while ago i wrote a C++ CLI Windows Form app, which compiled fine in Visual Studio 2013. Now i wanted to recompile it in Visual Studio 2015 Update 1 but i'm facing a problem, and after hours of ...
0
votes
2
answers
164
views
Is it OK to make a stdfx.h file myself?
Now, I realized that I need a precompiled header for my project. However, at the beginning, I created my project as an empty project which doesn't have a stdfx.h header file. So, this is what I did:
- ...
3
votes
1
answer
8k
views
Why do i have to #include "stdafx.h" in Microsoft visual studio c++ applications?
If i use a normal text editor or Code::Blocks this problem didn't occur.
but in visual studio , I have to include stdafx.h header file in order to compile the program without errors. I want to know ...
0
votes
1
answer
66
views
Reference a variable in a library that's declared in a dependent application
I can't remember what the rules are here, in my application project I currently declare a global variable in stdafx.h/cpp:
extern const char *LOGFILE = "test.log"
I've found that a library needs to ...
1
vote
2
answers
12k
views
error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
I have a project, originally developed on Microsoft Visual C++ . NET, Version 7.0.9466 and it works very well. I tried to use MS 2013 to run my project, and when I try to build the project, I have ...
-2
votes
1
answer
715
views
fatal error #1035: Can't find include file "stdafx.h"
I've started using Pelles C compiler as Microsoft Visual Studio won't work on my laptop. So, whenever I debug the following program, I get the "fatal error #1035: Can't find include file "stdafx.h". ...
3
votes
1
answer
1k
views
Precompiled Header and MSBuild
I have a precompiled header that needs to be included atop each .cpp in my project. I fear that I will waste a lot of time explaining and fixing that in coworkers code.
Is there an MSBuild step that ...
0
votes
1
answer
2k
views
Header files included in stdafx.h are not found
i'm using visual studio 2008. I include some includes ( boost headers ) in the stdafx.h but, now they arent found by the compiler ( lexical_cast not found for example ). I included stdafx.h on the top ...
0
votes
1
answer
1k
views
two projects using same .cpp file & header which has include "stdafx.h"
I have several functions in a .cpp file and I want several of my projects use the same file.
So instead of copy them to different directories just add them (from original location) to project file in ...
3
votes
1
answer
3k
views
error: 'CAtlServiceModuleT' : is not a member of 'ATL'
Building correctly a C++/ATL project :
I'm trying to use my MFC code into an ATL (Service EXE) project. In which, I've included all my Existing Items. When I've configured the project to Use MFC in a ...
3
votes
1
answer
2k
views
Sytem-wide Hotkey Shortcut(Windows/Qt) : Prevent window lock?
I am trying to figure a way I can use a system wide hot-key in my Qt application. To check for messages with GetMessage you need a while() loop. This is causing the window to lock up and become ...
3
votes
0
answers
1k
views
MFC in Visual Studio 2012 - afx.h file not found
I created an new static library project in VS 2012, with option MFC selected.
It created few files in the project, stdafx.h, targetver.h, stdafx.cpp. However in stdafx.h there are includes for afx.h, ...