Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8348323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:39:28+00:00 2026-06-09T07:39:28+00:00

Ihave simple test console application. I’m trying to use function nike2 from defined in

  • 0

Ihave simple test console application. I’m trying to use function nike2 from defined in simple.h file and realization is in simple.cpp. Both simple.h and simple.cpp files are in different directory than main project.

I have added simple.h to “Header files” and simple.cpp to “Source files” in project explorer (I’m not sure it is needed)

Console app:

#include "stdafx.h"
#include "..\..\simple.h"

int _tmain(int argc, _TCHAR* argv[])
{
nike2(5);
return 0;
}

Simple.h

#include <cstdlib>
#include <iostream>

#ifndef MEMORY
#define MEMORY

int var;
int  nike2(int f);

#endif /*MEMORY*/

Simple.cpp

#include <cstdlib>
#include <iostream>
#include "simple.h"


int  nike2(int f)
{
 return 0;
}

While compile I got error:

Error   4   error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?   c:\c\simple.cpp 11  1   usingHeader

Why? What is magic “StdAfx.h” used for?

UPD

simple.cpp now looks this way, but still have the same error

#include "C:\c\usingHeader\usingHeader\stdafx.h"
#include <cstdlib>
#include <iostream>
#include "simple.h"


int  nike2(int f)
{
return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:39:30+00:00Added an answer on June 9, 2026 at 7:39 am

    Stdafx.h is used for making pre-compiled headers. It contains some of the most standard and commonly used includes.

    That is made mainly to speed-up the compilation process, because WinAPI is a very heavy thing.

    You could also check this question, it has a more detailed answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple C console application and I'm trying to test it with
I have a simple test application (C# console application) that does an HTTP GET
I have a simple Java console application and would like to test its input
I have a simple console application using MassTransit. My bus is configured to use
I have a simple test case failing in Django: Model (app/models.py): from django.db import
I have made a simple test application for the issue, two winforms each containing
I have a console application written in c++. It simply reads an integer from
I have written a simple test application using asp.net mvc with C#. The application
I have setup a very simple test application to try RESTeasy on Jboss AS
My console .NET application has several app domains. My wish is simple - console

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.