943,888 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 4624
  • C RSS
You are currently viewing page 1 of this multi-page discussion thread
Feb 8th, 2009
0

Code::blocks compilation error

Expand Post »
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:

CPP Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 11
Solved Threads: 11
Junior Poster in Training
Alibeg is offline Offline
81 posts
since Aug 2008
Feb 8th, 2009
0

Re: Code::blocks compilation error

Should be iostream.h and you should be using std::cout
Chris
Reputation Points: 325
Solved Threads: 118
Master Poster
Freaky_Chris is offline Offline
702 posts
since Apr 2008
Feb 9th, 2009
0

Re: Code::blocks compilation error

ive learnt c in wrong way...using compilers that compile everything makes you forget standard ways
Reputation Points: 11
Solved Threads: 11
Junior Poster in Training
Alibeg is offline Offline
81 posts
since Aug 2008
Feb 9th, 2009
1

Re: Code::blocks compilation error

Also it should be int main and return 0

Chris
Reputation Points: 325
Solved Threads: 118
Master Poster
Freaky_Chris is offline Offline
702 posts
since Apr 2008
Feb 9th, 2009
0

Re: Code::blocks compilation error

yeah i konw that thanks
Reputation Points: 11
Solved Threads: 11
Junior Poster in Training
Alibeg is offline Offline
81 posts
since Aug 2008
Feb 15th, 2009
0

Re: Code::blocks compilation error

C++ Syntax (Toggle Plain Text)
  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.
Reputation Points: 11
Solved Threads: 11
Junior Poster in Training
Alibeg is offline Offline
81 posts
since Aug 2008
Feb 15th, 2009
0

Re: Code::blocks compilation error

c++ Syntax (Toggle Plain Text)
  1. #include <iostream>
Reputation Points: 1234
Solved Threads: 347
Postaholic
ArkM is offline Offline
2,001 posts
since Jul 2008
Feb 16th, 2009
0

Re: Code::blocks compilation error

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
Reputation Points: 325
Solved Threads: 118
Master Poster
Freaky_Chris is offline Offline
702 posts
since Apr 2008
Feb 16th, 2009
0

Re: Code::blocks compilation error

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?
Reputation Points: 1234
Solved Threads: 347
Postaholic
ArkM is offline Offline
2,001 posts
since Jul 2008
Feb 17th, 2009
0

Re: Code::blocks compilation error

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
Reputation Points: 11
Solved Threads: 11
Junior Poster in Training
Alibeg is offline Offline
81 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Binary Add and Substraction
Next Thread in C Forum Timeline: I have a problem that needs urgently to resolve many





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC