Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem in creating Project !!! 1

Status
Not open for further replies.

HadiRezaee

Technical User
Mar 9, 2001
165
IR
Hi all,
I want to write API program by VC++,
I create cpp file and i wrote my source code, then i create rc file and i add some icon and ...
Now, i want to create a project that i can add my cpp and rc files to prject.
How can i do this ?

I choosed MakeFile in File->New, and i added my files to project, but when i compile, compiler indicate to me Linker problem in Setting menu !!!
 
No, at the first you will create a Win32 exe application type project. After it, in the workspace window it the tab files, add files by RightClick->AddFile. If the file is present in the list it does not mean what it is created. You should open it and save. On open you'll get some "warnings" what file does not exist..., press ok. John Fill
1c.bmp


ivfmd@mail.md
 
Hi John,
Now i got this error:

fatal error C1010: unexpected end of file while looking for precompiled header directive

How can i solve it ?
 
I think you've forgotten to post somewhere a ; in a .h file after a class definition. John Fill
1c.bmp


ivfmd@mail.md
 
also try to put #include "afx.h" at the first of each cpp file, in the case if the project has a such one. John Fill
1c.bmp


ivfmd@mail.md
 
Hi John,
I have DX.cpp and DX.rc in source files section ...
And resource.h in header files section ...
And icon1.ico in resource files section ...
I wrote #include <windows.h> and #include &quot;resource.h&quot; in DX.cpp, i add #include <afx.h> but ...
I'm sure i have not any error in my source code in DX.cpp, please help me !!!


 
I said, #include &quot;afx.h&quot;, very sorry, is a mistake. You should #inlcude &quot;stdafx.h&quot;. If you don't have such one in the project create and add it. A good idea is to generate some new MFC project, and add all your files to it, or to copy the stdafx.h to your first project and see what to change and what no. The main ide of stdafx.h is in theese lines:
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

You can put them instead of #include&quot;stdafx.h&quot;
John Fill
1c.bmp


ivfmd@mail.md
 
Yesssssssssssss,
Thanks alooot for your answer, it work perfectly !!!
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top