Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,261 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,171 people online right now. Registration is fast and FREE... Join Now!




windows visual C++ 2008 building problem

 
Reply to this topicStart new topic

windows visual C++ 2008 building problem

lightingstriker
13 Oct, 2008 - 04:46 PM
Post #1

New D.I.C Head
*

Joined: 13 Oct, 2008
Posts: 4

hi,
I have been learning to use the visual C++ 2008 express edition from Windows which i downloaded for the windows web site. I'm new to programing and still getting the hang of it all. I was wondering if anyone would help me with a problem with compiling a code. When ever its done compiling a code the output says 1 failed, and a small window pops up and says system cannot find file specified, and the command promp will not appear. i tryed to make what seems to be the most basic code called "Hello World".

this is the code just in case its the problem

CODE
#include "Hello World.h"

int main (int argc, char* argv[])
{
    std::cout<<"Hello, World!";
    char myLine[100];
    std::cin.getline(myLine,100);
    return 0;
}



hope you can help thanks,


(p.s. hopefully you understand what im trying to say, dont quiet know all of the names/symbols of the language)
User is offlineProfile CardPM
+Quote Post

MorphiusFaydal
RE: Windows Visual C++ 2008 Building Problem
13 Oct, 2008 - 06:26 PM
Post #2

D.I.C Lover
Group Icon

Joined: 12 May, 2005
Posts: 1,104



Thanked: 8 times
Expert In: Hardware, Networking

My Contributions
Why are you including "Hello World.h"? I would bet my manly parts that you're not using custom includes yet.

You should read the tutorial you're following, and use the proper includes.

It should look something like this:

cpp

#include <iostream>
using namespace std;


The error you're getting about not being able to find a file is the compiler trying to find "Hello World.h", which doesn't exist, and throwing a fit.
User is offlineProfile CardPM
+Quote Post

lightingstriker
RE: Windows Visual C++ 2008 Building Problem
13 Oct, 2008 - 07:07 PM
Post #3

New D.I.C Head
*

Joined: 13 Oct, 2008
Posts: 4

i think im just going to have to read and read about how C++ works.

i hardly understood anything you said.


thank you anyway
User is offlineProfile CardPM
+Quote Post

RedSonja
RE: Windows Visual C++ 2008 Building Problem
13 Oct, 2008 - 10:40 PM
Post #4

D.I.C Head
Group Icon

Joined: 4 Sep, 2008
Posts: 170



Thanked: 3 times
Dream Kudos: 25
My Contributions
In your Visual Studio you can initialise an application using the wizard, and it will probably come up with hello world already in place. I know this is so because I always have to delete that bit.

So try that and you will have a version that already works. Then you can build on that. Don't be put off if things don't work first time. They wouldn't need us if they did.
User is offlineProfile CardPM
+Quote Post

redscarf
RE: Windows Visual C++ 2008 Building Problem
14 Oct, 2008 - 03:40 AM
Post #5

New D.I.C Head
*

Joined: 8 Oct, 2008
Posts: 5

QUOTE(lightingstriker @ 13 Oct, 2008 - 05:46 PM) *

hi,
I have been learning to use the visual C++ 2008 express edition from Windows which i downloaded for the windows web site. I'm new to programing and still getting the hang of it all. I was wondering if anyone would help me with a problem with compiling a code. When ever its done compiling a code the output says 1 failed, and a small window pops up and says system cannot find file specified, and the command promp will not appear. i tryed to make what seems to be the most basic code called "Hello World".

this is the code just in case its the problem

CODE
#include "Hello World.h"

int main (int argc, char* argv[])
{
    std::cout<<"Hello, World!";
    char myLine[100];
    std::cin.getline(myLine,100);
    return 0;
}



hope you can help thanks,


(p.s. hopefully you understand what im trying to say, dont quiet know all of the names/symbols of the language)



This one below is the code for"Hello World" in Visual C++ 2008 express ed.



// HelloWorld.cpp : Defines the entry point for the console application.






#include <iostream>
#include <conio.h>
using namespace std;


int main()

{
cout << "HelloWorld" ;

cout << endl;
cout << endl;

cout <<" Please Press Enter to Finish";
return 0;
}



User is offlineProfile CardPM
+Quote Post

lightingstriker
RE: Windows Visual C++ 2008 Building Problem
14 Oct, 2008 - 06:29 PM
Post #6

New D.I.C Head
*

Joined: 13 Oct, 2008
Posts: 4

thank you for the code you gave me it works but the command prompt stays in view for about a second and then disappears. how do i get it to stay on screen longer?
User is offlineProfile CardPM
+Quote Post

JackOfAllTrades
RE: Windows Visual C++ 2008 Building Problem
14 Oct, 2008 - 06:33 PM
Post #7

Cantankerous Old Fart
Group Icon

Joined: 23 Aug, 2008
Posts: 556



Thanked: 55 times
Dream Kudos: 50
My Contributions
Read the pinned topic Holding The Execution Window Open.
User is online!Profile CardPM
+Quote Post

UG Cyber
RE: Windows Visual C++ 2008 Building Problem
14 Oct, 2008 - 07:18 PM
Post #8

D.I.C Head
**

Joined: 24 Jul, 2008
Posts: 185



Thanked: 3 times
My Contributions
QUOTE(JackOfAllTrades @ 14 Oct, 2008 - 07:33 PM) *

Read the pinned topic Holding The Execution Window Open.



the iostream that is being included is important, it defines the methods 'cout <<', 'cin >>' and alot more. But for future reference, i would stray away from Visual C++ as much as you can! If you want to do just console, then i would use Dev-CPP (Its free and a good compilier). But if you think that you will stray to GUI (Graphical User Interface) i would use something like Borland C++ Builder.

Just a heads up biggrin.gif
User is offlineProfile CardPM
+Quote Post

lightingstriker
RE: Windows Visual C++ 2008 Building Problem
14 Oct, 2008 - 07:45 PM
Post #9

New D.I.C Head
*

Joined: 13 Oct, 2008
Posts: 4

thank you everyone for helping me i understand now and it all works great i just had to put some time into it

thanks again
User is offlineProfile CardPM
+Quote Post

redscarf
RE: Windows Visual C++ 2008 Building Problem
15 Oct, 2008 - 10:27 AM
Post #10

New D.I.C Head
*

Joined: 8 Oct, 2008
Posts: 5

the Hello World stays just a second on the cmd prompt because is just a line and is not the usual "question/answer" where you have to type something: in this case it will wait for you to type and answer to whatever you have written. If you really want to see the output on the cmd prompt for some more time use the cmd prompt internal to your windows program (start-accessory-cmd prompt) and drag and drop the program that you will find in the "debug" folder of your file Hello World, click enter.
See the attachment.


User is offlineProfile CardPM
+Quote Post

dwayne
RE: Windows Visual C++ 2008 Building Problem
15 Oct, 2008 - 04:21 PM
Post #11

New D.I.C Head
*

Joined: 2 Aug, 2008
Posts: 39


My Contributions
I have honestly never seen a pickier program than VC08. I started with express, then upgraded; if for nothing else for a good web development IDE, as I can't justify buying CS4 and would rather have a better multitasker. All I really need know is Photoshop and maybe Acrobat; though, I will probably stick with CS3.

Honestly though, I have grown somewhat fond of the picky VS08. I would rather it find small errors than the end user find them. That is one way to look at it.

This post has been edited by dwayne: 15 Oct, 2008 - 04:37 PM
User is offlineProfile CardPM
+Quote Post

audi2000
RE: Windows Visual C++ 2008 Building Problem
16 Oct, 2008 - 06:09 AM
Post #12

New D.I.C Head
*

Joined: 15 Oct, 2008
Posts: 6

QUOTE(lightingstriker @ 14 Oct, 2008 - 07:29 PM) *

thank you for the code you gave me it works but the command prompt stays in view for about a second and then disappears. how do i get it to stay on screen longer?


Run the program via "start without debugging" under debug tab
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/2/08 04:37AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month