public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "sreevatsan at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/21287] New: Problems while compiling with some math functions. Date: Fri, 29 Apr 2005 17:26:00 -0000 [thread overview] Message-ID: <20050429172627.21287.sreevatsan@gmail.com> (raw) I am trying to complie a simple program with math functions sqrt() and fabs using gcc 3.4.3 (Red Hat 3.4.3-9.EL4). I am not able to compile without including #include <math.h> but same code works with earlier versions of gcc 3.3.3 (Suse ) and gcc 3.3.3 (Red Hat 3.2.3-42). Code: #include<iostream.h> int main() { double k =1.4; cout<<sqrt(k)<<endl; cout<<fabs(k)<<endl; return 1; } Compilation command: g++ -o main main.cpp -w Error: main.cpp: In function `int main()': main.cpp:5: error: `sqrt' undeclared (first use this function) main.cpp:5: error: (Each undeclared identifier is reported only once for each function it appears in.) main.cpp:6: error: `fabs' undeclared (first use this function) I have a large piece of software that have code in this manner i.e, using math functions without including #include<math.h> and would like to migrate to gcc 3.4.3. Please do advice. Thanks, -- Summary: Problems while compiling with some math functions. Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sreevatsan at gmail dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21287
next reply other threads:[~2005-04-29 17:26 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-04-29 17:26 sreevatsan at gmail dot com [this message] 2005-04-29 17:52 ` [Bug c++/21287] " pcarlini at suse dot de
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20050429172627.21287.sreevatsan@gmail.com \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).