V
V
vanslam82017-03-05 12:38:42
Programming
vanslam8, 2017-03-05 12:38:42

Visual Studio 2017 .exe file not being created.?

How I created the project:
File - Create - Project...
In the settings I specify "clean project"
Then I create a file:
Project - Add new element...
Visual c++ - File c++, click add.
I am writing a program:

#include <iostream>
using namespace std;

void main(); {
  int a, b, c, d;

  cout << "Enter the 1st number: ";
  cin >> a;

  cout << "Enter the 2nd number: ";
  cin >> b;

  c = a^b;

  cout << a << " to the power of " << b << " equals: ";
  cin >> d;

  if (c == d) cout << "Correct!";
  else if (c > d) cout << "Your answer is lower!";
  else cout "Your answer is bigger!";
  
  system("pause");
}

(Solution configuration - Release, Platforms x86)
Then I press "F7"
In the output it says: 1>------ Build started: project: ConsoleApplication1, Configuration: Release Win32 ------
1>Source.cpp
1> C:\Program Files\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.24930\include\crtdefs.h(10): fatal error C1083: Cannot open include file: corecrt.h: No such file or directory
1>Building project "ConsoleApplication1.vcxproj" failed.
========== Build: successful: 0, with errors: 1, unchanged: 0, skipped: 0 ==========
I.e. it cannot find the path to the file, and even more so, it is not in the folder at all, although when saving the file/project, it should have been created and placed in the .../ConsoleApplication1 folder (If the name is by default).
A window with the following message also crashes: "The program <path> cannot be started. The specified file cannot be found."
Tried with simpler codes like "hello world!" and even an empty program, just with the main function, the same story. The problem is 100% not in the code.
Why the file is not being created I have no idea at all, googling the problem, it turned out that a similar problem occurs for everyone who sits on Windows 7 (like me) or creates a file in a different way than mine.
I also tried to suspend the antivirus and even remove it, it did not help.
Please help me solve this problem and let me know what's going on.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2017-03-05
@GavriKos

exe is not being created because there is a compilation error.
How to fix this error:
- reinstall vijla
- stackoverflow.com/questions/38290169/cannot-find-c...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question