June 15th, 2003, 03:10 PM
another C++ compiler situation
I just got DEv- C++ compiler from a cd contained in a book I just bought. I can't get it to compile anything!! I write the program:
Then I compile(which by the way, do I have to save in a certain location?) and i click on the icon which is just for the source code, not the exe file. Then if i click run, it says the source is not compiled. Anyone have suggestions?
With what weapons World War Three will be fought, I do not know, but World War Four will be fought with sticks and stones.
June 15th, 2003, 03:11 PM
Add a "cin >> " statement, the window closes at the end of every program, you need something to keep it open and the "cin >>" statement should do it.
The "return" statement should also be in the "int main()", additionally, are you hitting run after it says that the source has been compiled?
June 15th, 2003, 03:15 PM
If you do not specify a location to which the compiled code must be saved it get saved into the default location.
With borland it is somewhere deep inside the 'program files' but I don't know for your compiler.
You must have givin it a name so do a search for the program.
Like 'dir /s hello.exe'. (use the name you gave the proggie).
June 15th, 2003, 03:17 PM
noODle, no I have Dev and you don't need to specify anything, everything is done for you... it has a GUI... you ought to try it.
July 1st, 2003, 06:02 PM
The same thing happened to me... i think the one in the book is defective... i just downloaded another one from www.bloodshed.net/ but if you really want to keep that one all you have to do is modify the sample apps that come with the cd.
You laugh because im different, i laugh because your all the same.
July 1st, 2003, 06:24 PM
when you return a value, you must be inside a function?
when you type "return 0;" that is the value you are returning for "int main()"
yeah, I\'m gonna need that by friday...
July 3rd, 2003, 09:16 PM
yeah tampabay was right, you must have a main() function and your return 0; has to be inside of main() Also, you shouldnt use #include <iostream.h> That is bad programming style because it is so old. If your using a very old compiler that is ok, but hopefully you are not. Instead use:
using namespace std;
This is better style.
Also i would suggest that you read the little book that teachs you how to use your compiler...i think it will answer a lot of your questions
Support your right to arm bears.
^^This was the first video game which i played on an old win3.1 box