Re: C++ problem need your input
Quote:
Originally posted here by M/S Vin
Hi, I'm a total beginner in C++. I am using Bloodshed Dev C-++ 4.01 Compiler. Now Im trying to get Hello World program to run, it compiles successfully but it won't Run. The command prompt blinks for one second and it disappears. Basically, it wont execute. I've enlist the help of Mathgirl but shes not too familiar with the compiler Im using, I've looked through this thread
I followed it but it wont work.
It's from the book teach Yourself C++ in 24 hours, although It'll take more than that.
This is the program I did:
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
return 0;
}
It compiles successfully but like I said before it won't execute, I can't see the result Hello World. How do I get this simple program up and running? I appreciate any help.
[ANSWER]
Remove the space between include and <iostream>
correct is:
#include<iostream>
[/ANSWER]
Re: Re: C++ problem need your input
Quote:
Originally posted here by djc314159
[ANSWER]
Remove the space between include and <iostream>
correct is:
#include<iostream>
[/ANSWER]
First I have to admit to an error, removing the space between <iostream> and include
is not the answer. I've looked further into the problem and here's what I found.
I'm running Windows xp and have the latest updates to both Windows and bloodshed c++.
When I run the referred to program I get 70 compiler errors:
typical error:
In file iostream
line 44 is bits/c++config.h, there is no such file or directory.
Indeed when I looked at file iostream it does refer to bits/c++config.h which is nonexistant,
however ming32/c++config.h does exist, hence all (or at least most) of the errors.
I sent an bug report to bloodshed via a forum and am awaiting an answer. I'll report here what
the say.
Sorry for the error.
Re: Re: Re: C++ problem need your input
Quote:
Originally posted here by djc314159
First I have to admit to an error, removing the space between <iostream> and include
is not the answer. I've looked further into the problem and here's what I found.
I'm running Windows xp and have the latest updates to both Windows and bloodshed c++.
When I run the referred to program I get 70 compiler errors:
typical error:
In file iostream
line 44 is bits/c++config.h, there is no such file or directory.
Indeed when I looked at file iostream it does refer to bits/c++config.h which is nonexistant,
however ming32/c++config.h does exist, hence all (or at least most) of the errors.
I sent an bug report to bloodshed via a forum and am awaiting an answer. I'll report here what
the say.
Sorry for the error.
I recieved a reply to my bug report.
Their suggestions follow:
Solution Number 1:
Copy the files of C:\Dev-Cpp\include\c++\mingw32\bits
to C:\Dev-Cpp\include\c++\bits
Solution Number 2:
Add C:\Dev-Cpp\include\c++\mingw32 to compiler/directories/C++ includes
For more information:
Goto the bloodshed forum: (use the about button to locate it)
Search for 4.9.7.0
Expand search: 4.9.7.0 BlackJak
or 4.9.7.0 DerekBaker
More: They reccommend trying solution 2 first since it's less intrusive.
I'm going to proceed to try to fix my problem using these suggestions.
In other words "physician heal thyself".
I'll report on my progress or lack thereof.
Remember, we're dealing with a Beta version and these kinds of problems
should be expected, so be patient.
Also, as they say "You get what you pay for".
Re: Re: Re: Re: C++ problem need your input
Quote:
Originally posted here by djc314159
I recieved a reply to my bug report.
Their suggestions follow:
Solution Number 1:
Copy the files of C:\Dev-Cpp\include\c++\mingw32\bits
to C:\Dev-Cpp\include\c++\bits
Solution Number 2:
Add C:\Dev-Cpp\include\c++\mingw32 to compiler/directories/C++ includes
For more information:
Goto the bloodshed forum: (use the about button to locate it)
Search for 4.9.7.0
Expand search: 4.9.7.0 BlackJak
or 4.9.7.0 DerekBaker
More: They reccommend trying solution 2 first since it's less intrusive.
I'm going to proceed to try to fix my problem using these suggestions.
In other words "physician heal thyself".
I'll report on my progress or lack thereof.
Remember, we're dealing with a Beta version and these kinds of problems
should be expected, so be patient.
Also, as they say "You get what you pay for".
Finally: I got my system to compile and run the subject program exactly as first reported.
I used solution 2 above.
I've detailed how I solved my problem in my latest journal entry.
I'm not saying this is the only solution, or the best solution, but it is the one
reccommended by BlackJak and it works for me.
It's worth noting that original problem my be something different since it was
originally reported that the system compiled ok but would not run. To run the
compiled program you should be in a DOS window not the I.D.E.