this is the first time ive used c++
im trying to compile this program........
#include <iostream.h>
int main()
{
cout << "hey there" << end1;
return 0;
}
ive got the program saved as first.txt
when i press f5 it ask if i want to create first.exe, then after that it says
file not found etcetcetc\first.exe
henszey 09-03-2002, 05:27 AM What program are you trying to use to compile it?
reboot 09-03-2002, 07:41 AM What do you mean you have the program saved as first.txt??
yes
i have saved it as
c:\first.txt
I Press f5 to run..it says
"This debug command requires an active project. Would you like to create a project?"
-Yes
"c:\debug\first.exe" This file does not exist. Do you want to build it?"
-Yes
" 'c:\debug\first.exe' File not found."
-ok
Then nothing happens, every time i press f5 this happens
i tried this on another computer ..a school one and the same thing happened.
I tried clicking on this in the build menu
Compile First.txt (Ctrl F7)
and this below is what is said
"Cannot compile the file 'C:\First.txt'; no compile tool is associated with the file extension."
reboot 09-03-2002, 08:12 AM Try naming it first.cpp
killerguppy101 09-03-2002, 12:10 PM is first.cpp also added to ur prog?
1 create new text
2 save as .cpp
3 add to prog
4 prog
5 compile & run
someone told me that you are supposed to run a ".bat" file after the installation of the visual c++
i remember the installation creating some file, and told me to run it i think, i cant remember what that file was, so if anyone knows what the file name is would be a great help
.BAT-file must mean that you have a warez version?
bionicdonkey 09-04-2002, 04:31 AM there's an error in your code on line 4 of your example
you put end1, it should be endl...try this:
#include <iostream>
using namespace std;
int main {
cout << "hello there" << endl;
return 0;
}
whats bat got to do with a warez version?
its part of the install, cuz it supposed to add lines toyour autoexec or something
ill retry compiling it now thanx bionic
saryon 09-04-2002, 07:42 PM I would suggest putting up a screen shot of your environment with everything expanded (I.E. all cpp files, headers, ya know, the tree on the left of the screen) it sounds like that is where your problem lies, it sounds like a problem with the way you set up your project.
heres a screen shot...
im not sure how to save it as cpp by the way..i dont see how
bionicdonkey 09-06-2002, 02:57 AM rename the file extention to .cpp
ok i did that
opened the sec.ccp file
it came up in a more programming like lookin screen..
but got this error..just like b4
ah i pressed f7 and it compiled a file
but then wheni pressed f5 this error message came up in the debug box
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
The thread 0xB34 has exited with code 0 (0x0).
The program 'C:\Andrews\C++\Debug\sec.exe' has exited with code 0 (0x0).
bionicdonkey 09-06-2002, 05:24 AM have u tried compiling from the command line?? that's how i used to do mine...not sure of the commands fo vc++...i use gcc
reboot 09-06-2002, 08:28 AM What exactly did you expect it to do? cout isn't going to display anything in Windows....
OnErr0r 09-06-2002, 08:35 AM Compiling just creates the obj. You need to build as well, which links and creates the exe. duh?
reboot 09-06-2002, 08:52 AM Even so, that program isn't going to do anything he can see when run in the IDE.
OnErr0r 09-06-2002, 09:20 AM no, just a console window with:
for
Press any key to continue
reboot 09-06-2002, 09:40 AM Will it? I didn't think it would do even that. But then, I've probably never tried it either....
OnErr0r 09-06-2002, 10:03 AM *nod*
|