round() with pgCC

Hello everyone,

I came across the following difficulty. When I compile a simple piece of code
with pgCC:

#include <math.h>

int main() {
return round(-2.5);

I get:

“main.cpp”, line 5: error: identifier “round” is undefined
return round(-2.5);
1 error detected in the compilation of “main.cpp”

It works fine in pure c, compiled with pgcc.

So, is it possible to use round() function directly in c++ code compiled with pgCC?
Any ideas?

Thanks a lot in advance,


A workaround is: pgcpp -D_ISOC99_SOURCE

We do not support c99 long double function. For more information, please check thread:


Dear Hongyon,

Thanks a lot for your info! -D_ISOC99_SOURCE does the trick.

Best regards,