Java

Reply

Join Date: Mar 2003
Posts: 11
Reputation: boohoo is an unknown quantity at this point 
Solved Threads: 0
boohoo boohoo is offline Offline
Newbie Poster

Java

 
0
  #1
Mar 12th, 2003
Thanx for everyone's reply. I'm more and more being put off Java, although it looks like a good language in practise, the way it looks as a GUI doesn't appeal. Anyone know of a good free C++ IDE ? I have tried Devc++ from bloodshed, but it wont let me compile for some reason.

You may move this thread to C++ if you wish to keep things tidy

Thanks In Advance,
Matt
Regards,
Matt :D
Reply With Quote Quick reply to this message  
Join Date: Mar 2003
Posts: 11
Reputation: boohoo is an unknown quantity at this point 
Solved Threads: 0
boohoo boohoo is offline Offline
Newbie Poster
 
0
  #2
Mar 12th, 2003
Sorry - looks like I pressed wrong button, I ment reply not new topic!

I apologise.
Regards,
Matt :D
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 1,135
Reputation: samaru is just really nice samaru is just really nice samaru is just really nice samaru is just really nice 
Solved Threads: 5
Team Colleague
samaru's Avatar
samaru samaru is offline Offline
a.k.a inscissor
 
0
  #3
Mar 12th, 2003
What error are you getting when you try to compile in Dev-C++? It's always worked fine for me.
Check out my blog at http://www.shinylight.com for more stuff about web dev.
Reply With Quote Quick reply to this message  
Join Date: Mar 2003
Posts: 11
Reputation: boohoo is an unknown quantity at this point 
Solved Threads: 0
boohoo boohoo is offline Offline
Newbie Poster
 
0
  #4
Mar 13th, 2003
[Warning] In function 'int main()'

'cout' undeclared (first use this function}


And here is the code I am using to build Hi World proggy, testing Dev cpp :

#include <windows.h>
using namespace std;
int main()
{
cout << "Hello World From About\n";
}

I think the header maybe iostream , but when I try this I get about 150 (not kidding) errors, reporting on lines that excede the amount used ( 6 ).

Anyone help ?
Regards,
Matt :D
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,024
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 126
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb
 
0
  #5
Mar 13th, 2003
When you have int main() it means that the function main() is returning a value of type int (an integer). Right after your cout statement you have to add a return (0); statement.
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,024
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 126
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb
 
0
  #6
Mar 13th, 2003
And yes, use iostream.h ... Sometimes Windows likes #include<iostream> instead of iostream.h though!
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Mar 2003
Posts: 11
Reputation: boohoo is an unknown quantity at this point 
Solved Threads: 0
boohoo boohoo is offline Offline
Newbie Poster
 
0
  #7
Mar 13th, 2003
It now says iostream not found and when iostream.h is tried, the same result.
Regards,
Matt :D
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 1,135
Reputation: samaru is just really nice samaru is just really nice samaru is just really nice samaru is just really nice 
Solved Threads: 5
Team Colleague
samaru's Avatar
samaru samaru is offline Offline
a.k.a inscissor
 
0
  #8
Mar 13th, 2003
Really? Hmm... what version of Dev-C++ are you using? The following works for me on Dev-C++ 4.0:


  1. #include <iostream.h>
  2.  
  3. int main() {
  4. cout << "Hello World From About\n";
  5. return 0;
  6. }
Check out my blog at http://www.shinylight.com for more stuff about web dev.
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 129
Reputation: Bob is an unknown quantity at this point 
Solved Threads: 1
Team Colleague
Bob Bob is offline Offline
Team Member
 
0
  #9
Mar 14th, 2003
The latest version of dev-cpp doesn't recognise <iostream.h>, you need to use the standard version of the same header - <iostream>. When you do, you need to qualify any entities from namespace std.

Here are two versions that do that, and should compile and run OK. If they don't, post back with your error messages.

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. cout << "hello, world" << endl;
  6. cin.get();
  7. }

or this:

  1. #include <iostream>
  2. int main()
  3. {
  4. std::cout << "hello, world" << std::endl;
  5. std::cin.get();
  6. }

Two things to note:

[1] The return statement is optional in main() (though some older compilers will complain)

[2] I added the cin.get() to stop your console window from disappearing before you've seen the output.
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 129
Reputation: Bob is an unknown quantity at this point 
Solved Threads: 1
Team Colleague
Bob Bob is offline Offline
Team Member
 
0
  #10
Mar 14th, 2003
One more thing, there was an installation problem with a recent version of dev-cpp - it missed a path from the compiler options (which leads to hundreds of error message when you try to compile pretty much anything at all).

Go to:

Tools ~ Compiler Options ~ Directories ~ C++ Includes and check that it lists the paths for:

..\include
..\include\c++
..\include\c++\mingw32

It's the last one that you may have missing, if so, add it.

And don't be put off, there's really very little wrong with dev-cpp and I'm sure you'll get a lot of pleasure out of using it. Good value for money IMHO.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC