By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,383 Members | 2,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,383 IT Pros & Developers. It's quick & easy.

file exists but still getting file not found error

lifeisgreat20009
P: 70
I am getting the following error :-

1>------ Build started: Project: Polygon Drawer, Configuration: Debug Win32 ------
1>Compiling...

1>Dialog.cpp

1>g:\my subjects\3rd semester\project samples for 3rd semester\visual c++ project samples\polygon drawer\dialog.h(4) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory

1>DrawerApp.cpp

1>g:\my subjects\3rd semester\project samples for 3rd semester\visual c++ project samples\polygon drawer\mainfrm.h(8) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory

1>MainFrm.cpp

1>g:\my subjects\3rd semester\project samples for 3rd semester\visual c++ project samples\polygon drawer\mainfrm.h(8) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory

1>Generating Code...

1>Build log was saved at "file://g:\MY SUBJECTS\3RD SEMESTER\PROJECT SAMPLES FOR 3RD SEMESTER\VISUAL C++ PROJECT SAMPLES\Polygon Drawer\Debug\BuildLog.htm"

1>Polygon Drawer - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I get the above error when I execute the code of my VC++ project....
I searched for this file afxwin.h in my PC and copied it to the directory
g:\my subjects\3rd semester\project samples for 3rd semester\visual c++ project samples\polygon drawer\

But still getting the same error after compiling and executing....
Please somebody help me regarding this................
Aug 6 '08 #1
Share this Question
Share on Google+
3 Replies


weaknessforcats
Expert Mod 5K+
P: 9,197
How is afxwin.h included?

If it is:

#include "afxwin.h"

then what you did in copying the file to your project directory will work.

If it is:

#include <afxwin.h>

then the file must be along a pre-defined path. (Tools/Options/Projects and Solutions/VC++ Directories/on right select "include files").
Aug 6 '08 #2

Banfa
Expert Mod 5K+
P: 8,916
afxwin.h is an MFC include file (and therefore I assume you are creating an MFC program). You should not copy it to your source directory or anywhere else.

If the compiler can not find it then the compiler is not set-up correctly.

Where did you find this file on your computer? Were any other MFC include files there? How are you calling the compiler, are you setting the include paths correctly?
Aug 6 '08 #3

Expert 100+
P: 464
If you are using visual C++ express MFC is not supported. There have been work arounds posted. You can read this thread for more details.
Aug 7 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.