Joined: 30 Jun 2004
Location: The Portland Group Inc.
|Posted: Thu Sep 30, 2010 3:32 pm Post subject:
By default the PGI C++ compiler includes the std namespace. Hence, you're getting a conflict between the std::abs and the abs defined in the C header file stdlib.h. Since "VL" is a double and can be cast to either an int or a long, the compiler doesn't know which abs you want.
Your options are to add the flag "--no_using_std" to tell the compiler to not use the std namespace by default, or explicitly cast VL to either int or long.
Hope this helps,
|% cat test.cpp
/* abs example */
int main ()
VL = 9.9999999;
ATOL = abs((long)VL);
% pgcpp test.cpp
"test.cpp", line 7: warning: variable "ATOL" was set but never used