C++ compiler problems with FC2

Paul paul at all-the-johnsons.co.uk
Mon Aug 30 22:47:46 UTC 2004


Hi,

> I've had a strange problem when trying to compile a C++ program.
> 
> On FC2, when using the standard C++ compiler (gcc 3.3.3), the first line 
> of the program (#include <iostream>) caused a raft of errors regarding the 
> file cmath.  I was then pointed to try gcc 2.96, but this didn't work for 
> other reasons.

Can you post an example? I've written and compiled well over 3000 source
files using gcc 3.3.3 and 3.4 without a hitch on the headers.

You should never use 2.96 for C++ - it's awful! Leave that to the debian
crew.

> However, on FC1 (with gcc3.3.1), the program compiled cleanly (and ran on 
> FC2).
> 
> What gives?

Without seeing code, no idea.

Does this compile for you

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
  cout << "sine 63 = " << sin(63) << endl;
  cout << "log to the base 10 of 54 = " << log10(54) << endl;
  double quick = (sin(53) * sqrt(14.3443) + tanh(22)) / log(61.444);
  cout << "quick = " << quick << endl;
}

This should give you...

sine 63 = 0.167356
log to the base 10 of 54 = 1.80618
quick = 0.606956

Very silly test, but should work without a hitch.

TTFN

Paul
-- 
"Our enemies are innovative and resourceful - and so are we,"
"They never stop thinking about new ways to harm our country and our
people - and neither do we." - George W. Bush, Aug 2004
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-test-list/attachments/20040830/030a677e/attachment.sig>


More information about the fedora-test-list mailing list