Visual C++ 2010 error. Can't Find program.exe when running - c++

This is the message I get
Unable to start program C:\Users\Documents\Visual Studio 2010\Projects\EULER'S Fixed\Debug\EULER'S Fixed.exe
The system cannot find the file specified.
Here is the Build Output
1>------ Build started: Project: EULER'S Fixed, Configuration: Debug Win32 ------
1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>C:\Users\adicpluplu\Documents\Visual Studio 2010\Projects\EULER'S Fixed\Debug\Debug\EULER'S Fixed.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

You have missed to define main:
int main()
{
//..
return 0;
}

You get that message when you fail to save all before the first compile.
I consider it to be a defect in 2010. Creating a new project, or adding files to a project or deleting files from a project don't actually save. You have to manually save before they are really there.

Select the properties for the file in which main is defined and make sure "item type" under "General" (under Configuration Properties) is set to "c/c++ compiler"

Related

Error in Visual studio 2015 after installing SFML

recently I've installe SFML for Visual studio 2015. I have read the tutorial for this specific task on there web site but after the test (compiling and running debug) this error show up:
https://pastebin.com/mY7r7zy9
1>------ Build started: Project: projet game, Configuration: Debug Win32 ------
1> main.cpp
1>MSVCRTD.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _WinMain#16 referenced in function "int __cdecl invoke_main(void)" (?invoke_main##YAHXZ)
1>C:\Users\Cewein\documents\visual studio 2015\Projects\projet game\Debug\projet game.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
why and what should i do ?
should i rename my main.cpp to winmain.cpp ?
thanks you for the help
P.S: VS2015 is one the main drive where the OS is (C:) but SFML the folder is on another drive (E:)
If your subsystem is set to Windows (/SUBSYSTEM:WINDOWS), you need to link sfml-main, which will define WinMain() and call main().
If your subsystem is set to Console (/SUBSYSTEM:CONSOLE), then you don't need to link sfml-main.
To change the subsystem, go to your project settings, then Properties -> Linker -> System -> SubSystem

Visual Studio error LNK2005

I'm having problems with Visual Studio. Even though the code worked earlier, I keep getting this error now:
1>------ Build started: Project: Lab3, Configuration: Debug Win32 ------
1>Q3.obj : error LNK2005: _main already defined in Q1.obj
1>C:\Users\Carlos\documents\visual studio 2010\Projects\Lab3\Debug\Lab3.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
You have two files (Q1 and Q3) that both define main. You can only define main once in the entire project.

visual studio fatal error LNK1120:

just i wanted to make a program using viual stidio 2010
when i do build i have this excaption
i just wrote empty main c++ program (no syntax errors)
what i got is:
1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>c:\users\dell\documents\visual studio 2010\Projects\test\Debug\test.exe :
fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
code is :
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World" << endl;
return 0;
}
please help me to fix it asap
thanks ,,
You created a Win32-Project! Make sure that you choose Console Application in the project wizard.
Look at your project property. Just go to project settings, linker settings, then system. Check your subsystem setting.You can change subsystem to "not set".It will link based on which entry point function you have defined.

VC 2008 fatal error C1047 cplus fix?

Hello everyone i am using VC 2008 c++ and i got some project that isn't mine.
The project rebuilds successfully, but the problem is the project doesn't create all the .lib files that are needed for another project and so i got:
1>------ Build started: Project: application_manager, Configuration: Release Win32 ------
1>Linking...
1>LINK : warning LNK4224: /OPT:NOWIN98 is no longer supported; ignored
1>fatal error C1047: The object or library file 'C:\Users\modestas\Desktop\代码\server\../contrib/lib/tinyxml/\tinyxml_stl.lib' was created with an older compiler than other objects; rebuild old objects and libraries
1>LINK : fatal error LNK1257: code generation failed
1>Build log was saved at "file://C:\Users\modestas\Desktop\代码\server\temp\application_manager\Release\BuildLog.htm"
1>application_manager - 1 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
this project already has tinyxml_stl.lib, but the tinyxml project doesn't build a new one so i got this error how to fix this error?
The error is caused by tinyxml_stl.lib being compiled using an older version of the compiler than you are using to compile application_manager
Since your tinylib project no longer creates this file as output I assume that this is simply the result of the previous developer leaving you with a mess of files. If you change your application_manager to link to the correct binaries created by tinyxml and remove the link to tinyxml_stl.lib you should be able to compile.

Build Error "LNK2019: unresolved external symbol _WinMain#16"

So, I am a total noob at C++ and I need serious help. I bet for some average users this is not even a problem, so please help me.
I wrote this in Visual Studio Professional as a Win32 console file.
#include <iostream>
using namespace std;
int main()
{
int i = 100;
return 0;
}
And in the console I get the following:
1>------ Build started: Project: Project1_RenatoAlegre, Configuration: Debug Win32 ------
1>Build started 1/25/2012 3:09:03 PM.
1>InitializeBuildStatus:
1> Touching "Debug\Project1_RenatoAlegre.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain#16 referenced in function ___tmainCRTStartup
1>c:\users\ren\documents\visual studio 2010\Projects\Project1_RenatoAlegre\Debug\Project1_RenatoAlegre.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:03.37
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I have no way of running the program because of this "1 failed" something. I must run the program in Visual Studio Professional.
Project properties -> C/C++ -> Linker -> System -> SubSystem: Console (/SUBSYSTEM:CONSOLE)
If you want a console project.
Please change the subsystem in your linker settings from Windows to Console.
Right click on the Project name in the Solution Explorer
Select Properties
Open Linker in Configuration Properties
Subsystem will be the first item on the list.
Select Console (/SUBSYSTEM:CONSOLE) on the dropdown