Code::blocks compilation error

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2008
Posts: 71
Reputation: Alibeg is an unknown quantity at this point 
Solved Threads: 10
Alibeg Alibeg is offline Offline
Junior Poster in Training

Code::blocks compilation error

 
0
  #1
Feb 8th, 2009
I'm new to this editor, i used Dev-Cpp, and i heard this is a better tool to program with. Problem is that Code::blocks wont compile this:

  1. #include <stream.h>
  2.  
  3. main ()
  4. {
  5. cout << "Hello world!\n";
  6. }
I switched to Code::blocks mainly because i'm using linux and i cannot (read: don't want to) complicate with Dev-Cpp. i did manage to run it using wine but i still cannot run exe's produced by Dev-Cpp. i think they can also be run using wine but here comes another problem - im using live session
i know i should install the system like normal man but that is not question, i need to know how can i make Code::Blocks compile that thing above
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 671
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Code::blocks compilation error

 
0
  #2
Feb 8th, 2009
Should be iostream.h and you should be using std::cout
Chris
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 71
Reputation: Alibeg is an unknown quantity at this point 
Solved Threads: 10
Alibeg Alibeg is offline Offline
Junior Poster in Training

Re: Code::blocks compilation error

 
0
  #3
Feb 9th, 2009
ive learnt c in wrong way...using compilers that compile everything makes you forget standard ways
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 671
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Code::blocks compilation error

 
1
  #4
Feb 9th, 2009
Also it should be int main and return 0

Chris
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 71
Reputation: Alibeg is an unknown quantity at this point 
Solved Threads: 10
Alibeg Alibeg is offline Offline
Junior Poster in Training

Re: Code::blocks compilation error

 
0
  #5
Feb 9th, 2009
yeah i konw that thanks
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 71
Reputation: Alibeg is an unknown quantity at this point 
Solved Threads: 10
Alibeg Alibeg is offline Offline
Junior Poster in Training

Re: Code::blocks compilation error

 
0
  #6
Feb 15th, 2009
  1. #include <iostream.h>
  2.  
  3. int main ()
  4. {
  5. std::cout << "Welcome to C++ programming!\n";
  6. return 0;
  7. }
wont compile on Code::Block on ubuntu Intrepid Ibex
says:
3: Syntax error: "(" unexpected

Press ENTER to coutinue.

i've just installed it so maybe it needs some configuring, but i heard that it already uses GCC compiler and has everything it needs to work well
http://www.codeblocks.org/features
Last edited by Alibeg; Feb 15th, 2009 at 6:13 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: Code::blocks compilation error

 
0
  #7
Feb 15th, 2009
  1. #include <iostream>
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 671
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Code::blocks compilation error

 
0
  #8
Feb 16th, 2009
ArkM this is the C forum....really should be using printf() so yer lol, but still i thought it was iostream.h in C?

then again I think im just going crazy xD
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: Code::blocks compilation error

 
0
  #9
Feb 16th, 2009
Oh yes but have a look at this main body

Well, "Problem is that Code::blocks wont compile this". What happens? Where are compiler diagnostics?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 71
Reputation: Alibeg is an unknown quantity at this point 
Solved Threads: 10
Alibeg Alibeg is offline Offline
Junior Poster in Training

Re: Code::blocks compilation error

 
0
  #10
Feb 17th, 2009
i know this should have been C++ but when i started i didnt have a clue whether it was c or c++ compiler (I could have posted a new thread but it seemed aggressive)
Diagnostics:
3: Syntax error: "(" unexpected

Press ENTER to coutinue.

i tried both iostream and iostream.h,and i did try printf also. nothing works. maybe an Intrepid Ibex that is making problems, but i still think im missing something in configuration
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC