Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: C/C++ Compilers  (Read 2211 times)

0 Members and 1 Guest are viewing this topic.
C/C++ Compilers
« on: September 01, 2006, 03:21:49 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 5213
Roghto, I'm having problems with compilers.

I have Dev-C++, But every piece of code that goes into it it errors and doesn't Compile. (I've even tried copying and pasting the code direct from the site).

So I got pissed off and downloaded Borland C++ and it works, but having to type c:\borland\bc... whatever just to compile it is annoying, is there any compilers you'd recommend? Free preferably, if not, meh! no loss there!

Any help would be appreciated!
Logged
Re: C/C++ Compilers
« Reply #1 on: September 01, 2006, 03:23:12 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Quote
I have Dev-C++, But every piece of code that goes into it it errors and doesn't Compile. (I've even tried copying and pasting the code direct from the site).
Thats your fault, don't blame the compiler. Most C++ compilers follow the C++ standard so if you get an error in Dev-C++ you will probably get an error in any compiler. (unless its just a compiler quirk)
Logged
Re: C/C++ Compilers
« Reply #2 on: September 01, 2006, 03:27:30 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 5213
Well it seems to work in Borland, but when I place teh code In Dev-C++ it bitches
Logged
Re: C/C++ Compilers
« Reply #3 on: September 01, 2006, 03:38:05 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Well it seems to work in Borland, but when I place teh code In Dev-C++ it bitches
Do you have Mingw installed?
Logged
Re: C/C++ Compilers
« Reply #4 on: September 01, 2006, 03:49:43 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 5213
Well it seems to work in Borland, but when I place teh code In Dev-C++ it bitches
Do you have Mingw installed?
Nope, wait, maybe... what is it?
Logged
Re: C/C++ Compilers
« Reply #5 on: September 01, 2006, 03:59:36 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Mingw is the compiler that the IDE Dev-C++ uses, if you have not got it installed and are trying to compile in Dev-C++ thats probably your problem. Download and install it :).
Logged
Re: C/C++ Compilers
« Reply #6 on: September 01, 2006, 04:04:36 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 5213
http://www.mingw.org/download.shtml#hdr6

Wow... Now I'm confused O.o
Logged
Re: C/C++ Compilers
« Reply #7 on: September 01, 2006, 04:26:36 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
You should have downloaded the copy of Dec-C++ that comes with MingW, that would have been easier for you. Anyway try this one.

http://prdownloads.sf.net/mingw/MinGW-3.1.0-1.exe?download
Logged

aab

^ Evolved from a Hobbit
Re: C/C++ Compilers
« Reply #8 on: September 01, 2006, 05:51:16 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 992
Lets see the code you are trying to compile; It could be pre standard.
Logged




I ♥ Sol
.... I ♥ Sol ? wtf how long has that been there? >_> *rrrrrrrrar*
  • MySpace
Re: C/C++ Compilers
« Reply #9 on: September 01, 2006, 06:41:02 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 5213
Code: [Select]
#include <iostream>

using namespace std;

int main ()
{
  cout<<"HEY, guess what, I'm alive =D. Oh, and Hello World\n";
  cin.get();

  return 1;

Thats it, It might be the code after all it is me. But when I copied it right of the site it still doesn't compile, well only with Borland
« Last Edit: September 01, 2006, 06:50:05 pm by bertfallen »
Logged

aab

^ Evolved from a Hobbit
Re: C/C++ Compilers
« Reply #10 on: September 01, 2006, 07:29:36 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 992
Well, its all fine, so theres definately something missing or messed up with the compiler.
Note: return 0 (not 1) from main to indicate success.
Logged




I ♥ Sol
.... I ♥ Sol ? wtf how long has that been there? >_> *rrrrrrrrar*
  • MySpace
Re: C/C++ Compilers
« Reply #11 on: September 01, 2006, 07:44:43 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 5213
I'll keep on using Borland til I find an Alternative
Logged

vroemer

Re: C/C++ Compilers
« Reply #12 on: September 04, 2006, 09:39:27 pm »
I always had this problem using devcpp and then using visual cpp try using oldschool iostream.h thus

Code: [Select]
#include <iostream.h>

using namespace std;

int main ()
{
  cout<<"HEY, guess what, I'm alive =D. Oh, and Hello World\n";
  cin.get();

  return 1;
}

not sure but that might do it... although you might not have to use a namespace for std I believe I heard that somewhere maybe not
Logged

aab

^ Evolved from a Hobbit
Re: C/C++ Compilers
« Reply #13 on: September 04, 2006, 10:10:11 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 992
No: Non standard, old.
Up to date, correct way:
Code: [Select]
#include<iostream>
using namespace std;

Depricated identifier-polluting warning-giving (old) way:
Code: [Select]
#include<iostream.h>

And:
Code: [Select]
return 0;

C++ is a messed up language.
It has been chaned alot over the years, and one of these changes forced the change of iostream insted of iostream.h : This change was and is for the better - Don't ignore it.
Logged




I ♥ Sol
.... I ♥ Sol ? wtf how long has that been there? >_> *rrrrrrrrar*
  • MySpace

vroemer

Re: C/C++ Compilers
« Reply #14 on: September 05, 2006, 09:51:11 pm »
I know that but not all compilers are up to date with the new way
Logged

aab

^ Evolved from a Hobbit
Re: C/C++ Compilers
« Reply #15 on: September 06, 2006, 10:48:04 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 992
Why use them then?; Because microsoft make people pay for new ones?

A compiler that old probably doesn't have things like covariant return types and partial specification; Imagine trying to learn something new, and it doesn't compile, only instead of just changing it to fit the old compiler as you suggest, it doesnt exist at all in the old compiler so its basically impossible to do. That would ... well ... suck !
Logged




I ♥ Sol
.... I ♥ Sol ? wtf how long has that been there? >_> *rrrrrrrrar*
  • MySpace
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.424 seconds with 70 queries.