This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libstdc++/3070: unresolved fsqrt at link using sqrt and <cmath>



>Number:         3070
>Category:       libstdc++
>Synopsis:       unresolved fsqrt at link using sqrt and <cmath>
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 06 18:16:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Pete Stieber
>Release:        gcc version 3.1 20010605 (experimental)
>Organization:
>Environment:
i686-pc-linux-gnu
Red Hat 7.1
>Description:
Error linking cpp modules that use <cmath> and sqrt.

/tmp/ccg374LU.o: In function `std::sqrt(double)':
/tmp/ccg374LU.o(.gnu.linkonce.t._ZSt4sqrtd+0x2a): undefined reference to `fsqrt'
collect2: ld returned 1 exit status
>How-To-Repeat:
gcc test.cpp
>Fix:
Use <math.h> instead of <cmath>.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="test.cpp"
Content-Disposition: inline; filename="test.cpp"

#include <cmath>

using namespace std;

int main()
{
  sqrt(10.0);
  return 1;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]