12 Replies - 23460 Views - Last Post: 12 January 2010 - 02:02 PM Rate Topic: -----

#1 Named_Life  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 14
  • Joined: 10-January 10

i can't compile with Code::blocks !

Post icon  Posted 10 January 2010 - 03:12 PM

im done with basics of vb ,im moving to C\C++ but ...
after downloading Code::Blocks 8.02 and minGW im still unable to compile anything using them
some told me that i can download them both at once in [i]codeblocks.org but its an unfound page :S
(dev is less complicated but i HAVE to work with code::blocks)
please help and thank you for your time =)
Is This A Good Question/Topic? 0
  • +

Replies To: i can't compile with Code::blocks !

#2 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3101
  • View blog
  • Posts: 19,141
  • Joined: 14-September 07

Re: i can't compile with Code::blocks !

Posted 10 January 2010 - 03:26 PM

What is the exact error you're getting?

Also, this will probably be moved to C/C++ or Computer Support.
Was This Post Helpful? 1
  • +
  • -

#3 OliveOyl3471  Icon User is offline

  • Everybody's crazy but me!
  • member icon

Reputation: 134
  • View blog
  • Posts: 6,581
  • Joined: 11-July 07

Re: i can't compile with Code::blocks !

Posted 10 January 2010 - 03:29 PM

Look at that, KYA can predict the future. :o

Moved to C and C++ forum.
Was This Post Helpful? 0
  • +
  • -

#4 Delta_Echo  Icon User is offline

  • D.I.C Addict

Reputation: 5
  • View blog
  • Posts: 722
  • Joined: 24-October 07

Re: i can't compile with Code::blocks !

Posted 10 January 2010 - 07:33 PM

To confirm, you did download C::B from here: http://www.codeblocks.org/
The version of MinGW that ships with Code::Blocks is slightly out of data,
follow these instructions to install and configure MingW for code::blocks:

1. Download MinGW Here.
2. Execute and follow the steps therein.
3. Launch Code::Blocks and goto Settings > Compiler And Debugger
4. In the dialog, go to the tab "Toolchain Executables".
5. At the "Compiler Installation Directory", set it to where you installed MinGW earlier (should be C:\MinGw)

Then make a new file "test.cpp" and write this into it:
#include <iostream>
using namespace std;

int main(void)
{
  cout << "Hello World!" << endl;
  cin.get();
  return 1;
}



That should compile and execute properly.
PM me for help if you want.

note: The compiler/build command is under "build".
Was This Post Helpful? 1
  • +
  • -

#5 Named_Life  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 14
  • Joined: 10-January 10

Re: i can't compile with Code::blocks !

Posted 11 January 2010 - 10:38 AM

i have aplied the steps one by one.. and it seems to be working
at least the errors list is appearing, witch means the compiler is working
but im still not sure because; when i try to compile the "hello world" code ;
#include <stdio.h>
#include <stdlib.h>

int main()
{
	printf("Hello world!\n");
	return 0;
	}


i get this error (Execution of 'mingw32-g++.exe -o bin\Debug\Haytt.exe obj\Debug\main.o' in 'C:\haytt_C\Haytt' failed.) is it the compiler again??
and when i copied/past the code u gave me it was worst :blink: alot of errors like (iostream: No such file or directory)
thank you alot for your time i realy apreciate that =)
Was This Post Helpful? 1
  • +
  • -

#6 jjl  Icon User is offline

  • Engineer
  • member icon

Reputation: 1072
  • View blog
  • Posts: 4,532
  • Joined: 09-June 09

Re: i can't compile with Code::blocks !

Posted 11 January 2010 - 10:51 AM

Are you sure your using a C++ compiler? you may be using a C compiler.

@Delta, why are you return a 1 from main?
Was This Post Helpful? 0
  • +
  • -

#7 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 282
  • View blog
  • Posts: 1,456
  • Joined: 16-May 09

Re: i can't compile with Code::blocks !

Posted 11 January 2010 - 11:02 AM

@Delta: also, int main(void) should be int main() as the standard says. this is C++ not C :)
Was This Post Helpful? 0
  • +
  • -

#8 borninlyoko  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 7
  • View blog
  • Posts: 350
  • Joined: 03-December 09

Re: i can't compile with Code::blocks !

Posted 11 January 2010 - 11:06 AM

Usually the Code::Blocks environment comes with a compiler. Open Code::Blocks and click on Settings > Compiler and Debugger... At the top of the page, there should be a list of compilers to choose from. Try selecting a different one than the one currently selected.

If for some reason it didn't come with a compiler, try looking at Freebyte. Try running the compiler independently.

Hope this helped,
Cheers,
Borninlyoko

This post has been edited by borninlyoko: 11 January 2010 - 11:06 AM

Was This Post Helpful? 1
  • +
  • -

#9 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 282
  • View blog
  • Posts: 1,456
  • Joined: 16-May 09

Re: i can't compile with Code::blocks !

Posted 11 January 2010 - 11:08 AM

I guess the problem is with an environment variable not set...
Was This Post Helpful? 0
  • +
  • -

#10 Named_Life  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 14
  • Joined: 10-January 10

Re: i can't compile with Code::blocks !

Posted 11 January 2010 - 02:47 PM

Guys its working now ..thanks all for trying to help me :blush:
wish me patience ..'cause this C\C++ really :angry: me sometimes !!
Was This Post Helpful? 0
  • +
  • -

#11 nanowire  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 107
  • Joined: 05-January 10

Re: i can't compile with Code::blocks !

Posted 11 January 2010 - 03:24 PM

I have had a very similar problem, Code::Blocks you have to go to New->C->C++ and it is annoying... But it is WAY better than other programs I have tried.

Oh yes, and thanks, Borninlyoko, that was the problem with my compiler also. Just needed to switch them out.

This post has been edited by nanowire: 11 January 2010 - 03:27 PM

Was This Post Helpful? 0
  • +
  • -

#12 borninlyoko  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 7
  • View blog
  • Posts: 350
  • Joined: 03-December 09

Re: i can't compile with Code::blocks !

Posted 12 January 2010 - 01:23 PM

Hope I helped anybody that had problems with "Code::Blocks" compiling,
Good luck and I wish you patience @Named_Life
Was This Post Helpful? 0
  • +
  • -

#13 Astraeus  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 23
  • View blog
  • Posts: 205
  • Joined: 17-November 09

Re: i can't compile with Code::blocks !

Posted 12 January 2010 - 02:02 PM

Thank you guys. o.o This helped me as well.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1