- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- problem with math functions
Operating System - HP-UX
1753753
Members
4618
Online
108799
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2004 09:44 PM
07-22-2004 09:44 PM
problem with math functions
Hi.
I just installed gcc-3.3.2 on a Hp-ux 11.0, from available binaries at the HP-UX software porting and archive center.
When I try to compile, I get the folowing error:
/usr/local/include/c++/3.3.2/cmath: In function `double std::abs(double)':
/usr/local/include/c++/3.3.2/cmath:172: error: `double std::abs(double)' conflicts with previous using declaration `double abs(double)'
/usr/local/include/c++/3.3.2/cmath: In function `double std::pow(double, int)':
/usr/local/include/c++/3.3.2/cmath:504: error: `double std::pow(double, int)' conflicts with previous using declaration `double pow(double, int)'
(Edited from include/c++/3.3.2/cmath)
I changed things from:
// Get rid of those macros defined in in lieu of real functions.
#undef abs // <--- This is one I had trouble with.
#undef div
// etc...
namespace std
{
inline double
abs(double __x)
{ return __builtin_fabs(__x); }
inline float
abs(float __x)
{ return __builtin_fabsf(__x); }
inline long double
abs(long double __x)
{ return __builtin_fabsl(__x); }
}
to:
// Get rid of those macros defined in in lieu of real functions.
#undef div
// etc...
namespace std
{
// Only undefine and replace abs if it is a macro
#ifdef abs
#undef abs
inline double
abs(double __x)
{ return __builtin_fabs(__x); }
inline float
abs(float __x)
{ return __builtin_fabsf(__x); }
inline long double
abs(long double __x)
{ return __builtin_fabsl(__x); }
#endif
}
Is it correct or not?
What is the "good" way to fix it?
Thanks
Pierre Burry
I just installed gcc-3.3.2 on a Hp-ux 11.0, from available binaries at the HP-UX software porting and archive center.
When I try to compile, I get the folowing error:
/usr/local/include/c++/3.3.2/cmath: In function `double std::abs(double)':
/usr/local/include/c++/3.3.2/cmath:172: error: `double std::abs(double)' conflicts with previous using declaration `double abs(double)'
/usr/local/include/c++/3.3.2/cmath: In function `double std::pow(double, int)':
/usr/local/include/c++/3.3.2/cmath:504: error: `double std::pow(double, int)' conflicts with previous using declaration `double pow(double, int)'
(Edited from include/c++/3.3.2/cmath)
I changed things from:
// Get rid of those macros defined in
#undef abs // <--- This is one I had trouble with.
#undef div
// etc...
namespace std
{
inline double
abs(double __x)
{ return __builtin_fabs(__x); }
inline float
abs(float __x)
{ return __builtin_fabsf(__x); }
inline long double
abs(long double __x)
{ return __builtin_fabsl(__x); }
}
to:
// Get rid of those macros defined in
#undef div
// etc...
namespace std
{
// Only undefine and replace abs if it is a macro
#ifdef abs
#undef abs
inline double
abs(double __x)
{ return __builtin_fabs(__x); }
inline float
abs(float __x)
{ return __builtin_fabsf(__x); }
inline long double
abs(long double __x)
{ return __builtin_fabsl(__x); }
#endif
}
Is it correct or not?
What is the "good" way to fix it?
Thanks
Pierre Burry
- Tags:
- g++
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP