Sign in to follow this  
Followers 0
cageman

compiling c++ program in visual studio 2010

8 posts in this topic

#1 ·  Posted (edited)

Hey guys. I hope this is the right place to ask this. I am trying to learn some c++ and i am doing something wrong it seems.

I am trying to compile this simple program in visual studio 2010 professional and using Microsoft .NET framework 4.0. I checked the directory and the file exists in the exact same directory shown in the error message. Here is my source, although it should be 100% correct:

#include <iostream>

using std::cout;

using std::endl;

int main()

{

cout << "Hello World!" << endl;

return 0;

}

When i try to it produces this error:

Error 1 error MSB4014: The build stopped unexpectedly because of an internal failure.

Microsoft.Build.Exceptions.BuildAbortedException: Build was canceled. MSBuild.exe could not be launched as a child node as it could not be found at the location "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe". If necessary, specify the correct location in the BuildParameters, or with the MSBUILD_EXE_PATH environment variable.

at Microsoft.Build.BackEnd.NodeManager.AttemptCreateNode(INodeProvider nodeProvider, NodeConfiguration nodeConfiguration)

at Microsoft.Build.BackEnd.NodeManager.CreateNode(NodeConfiguration configuration, NodeAffinity nodeAffinity)

at Microsoft.Build.Execution.BuildManager.PerformSchedulingActions(IEnumerable`1 responses)

at Microsoft.Build.Execution.BuildManager.HandleNewRequest(Int32 node, BuildRequestBlocker blocker)

at Microsoft.Build.Execution.BuildManager.IssueRequestToScheduler(BuildSubmission submission, Boolean allowMainThreadBuild, BuildRequestBlocker blocker)

I tried to search the internet, but the people who have the same error didn't help me with a working solution. Furthermore command line compiling works fine ie: cl /EHsc filename.cpp

produces an exe and if i run it from the command line says hello world. What is the problem with the compiler in visual studio? On the Internet some people said it has something to do with the length of the username of the administrator, but its shorter then 20 characters.

Thanks in advance!

Edited by cageman

Share this post


Link to post
Share on other sites



I assume you've uninstalled and reinstalled Visual Studio?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Yes i did try that. I just keeps giving me this message..

it seems i have exactly this issue:

http://connect.microsoft.com/VisualStudio/feedback/details/535129/error-msb4014-when-building-any-visual-c-project#

but the interesting is.. what do they mean with user? the computer user? i did change it too something short now to be certain, bu t the map names in C:\Documents and Settings\Username have still the old username. Could that be the problem?

Edited by cageman

Share this post


Link to post
Share on other sites

Save the project in a folder with a name that won't cause problems.

I have a programming folder in C:\ that has all the languages and projects I do - I did have a folder called 'C#' but that gave a lot of problems so I now use 'CSharp' instead. I assume you have a similar problem... Just set the folder for projects somewhere with a simple name and it'll work fine.

Mat

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

your solution didn't solve my problem, but it turned out that the length of the username was indeed the problem. After changing some things it suddenly worked. Anyway, thanks for the help! ;)

last question: What is a good forum for asking questions about C++?

Edited by cageman

Share this post


Link to post
Share on other sites

@cageman

in VS2008 before you start writing your code make sure the following ||follow this procedure :

1-any code should be write in solution "project" before you compile it.

2-name the the project with the name of your main source code .

so:

file>>new project >> Visual c++ >>win 32 >> win32 console app

chose a name ie:

then make sure to clic check on empty project

application settings [*]Empty project

then finish

go to solution explorer tap right clic on source >>add new item >>

Posted Image

☺.cpp

then you are done

i hope this tips helped you

Share this post


Link to post
Share on other sites

@ all

i am new here and i am looking for some help ;)

can autoit script work in background window ?

to explain :

let assume that i have a script that automatically upload multi-files to multi file host site.

and this script use GUI "mouse"to find Upload button, can i use web browser while the script is doing his job .

i am new in Scripting language

just have some experience in c++

<>i wasn't able to write new topic so i write it here :)<>

sorry for my English

thanks

Share this post


Link to post
Share on other sites

The free Microsoft Visual C++ 2010 Express, along with the rest of the Microsoft Visual Studio 2010 Express suite of programs, is available. It purportedly compiles, assembles and links several times faster than GCC.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0