You guys are probably getting sick of me, but I'm back for more help. :P I've already gotten a little bit of help from one user, but I didn't want to bug him, so here goes. I just started getting in to C++, and I am having a problem compiling project from one of my tutorials. The code is:
The error I am getting is:Code:#include <iostream> #include <stdlib.h> int main(int argc, char *argv[]) { cout << "Hello, I am your computer talking." << endl; system("PAUSE"); return 0; }
The compilation log is:Code:Line: 2 File: 2 C:\Documents and Settings\Owner\My Documents\Visual Studio Projects\C++ For Dummies Projects\FirstProject\2 unable to run program file. Message: unable to run program file.
I've checked line 2, that is where the error is suppose to occur, however I am not noticing anything wrong with it. I'm using Dev-C++ 4.9.7.0 if it matters all that much. Any help will be appreciated, thanks again guys.Code:Compiler: Default compiler Building Makefile: "C:\Documents and Settings\Owner\My Documents\Visual Studio Projects\C++ For Dummies Projects\FirstProject\Makefile.win" Executing make... make.exe -f "C:\Documents and Settings\Owner\My Documents\Visual Studio Projects\C++ For Dummies Projects\FirstProject\Makefile.win" all Execution terminated![]()
+ Reply to Thread
Results 1 to 6 of 6
-
-
Brings back painful memories from high school. Took it for 3 years and didnt learn a thing. :P
It's been a while since I did C++ so I'm probably way off, but here goes. Isnt iostream supposed to be iostream.h? Also, dont you need add a string library to recognize your cout statement? Again, probably not the reason why it wont compile, but worth a shot.
One more thing, I've found that borland is more user friendly than dev. -
At a guess I would say that "PAUSE" is not an executable. It's probably a built-in command in cmd.exe, which would mean that you could use it in .BAT scripts but not in a system() call.
A man without a woman is like a statue without pigeons. -
Thanks for the responses so far guys, I am still a newbie to C++ though. The only thing I can pick up out of what you two guys said was to make
Code:#include <iostream>
Code:#include <iostream.h>
-
Oh guys, ran in to a problem. Borland's C++ Developer is for 6, not .Net, and my tutorial is for .Net, not 6.
-
Problem solved, I think. Apparently Dev-C++ has a problem with being installed into a directory with spaces, well if you look at my other posts there were alot of spaces.
Here is what I posted on bloodshed.net/forum:
After uninstalling, reinstalling into a directory with no spaces, uninstalling and removing application data, and reinstalling in to a directory with no spaces all is good. Thanks guys.
Similar Threads
-
Help compiling dtcaenc on mac,...
By Selur in forum ProgrammingReplies: 3Last Post: 26th Apr 2012, 13:54 -
download Win 8 Dev preview
By deadrats in forum ComputerReplies: 2Last Post: 15th Sep 2011, 01:26 -
Compiling several dvds at once ?
By nymphadora in forum ComputerReplies: 8Last Post: 25th Apr 2009, 11:09 -
GFD Dev: Remember last submenu button?
By spamiaint in forum Authoring (DVD)Replies: 2Last Post: 7th Jun 2008, 12:58 -
Compiling a DVD
By LiCal in forum Newbie / General discussionsReplies: 2Last Post: 25th Apr 2008, 13:31