简体   繁体   中英

error C2039: 'fabs': is not a member of '`global namespace''

My project compiled well, even with full rebuild, then I modified a single parameter in a dialog resource and now it doesn't compile even changing back the parameter, I have many errors, beginning with that:

1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cstdlib(24,18): error C2039: 'fabs': is not a member of '`global namespace''
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cstdlib(24,22): error C3861: 'fabs': identifier not found
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cstdlib(28,18): error C2039: 'fabsf': is not a member of '`global namespace''
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cstdlib(28,23): error C3861: 'fabsf': identifier not found
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cstdlib(32,18): error C2039: 'fabsl': is not a member of '`global namespace''
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cstdlib(32,23): error C3861: 'fabsl': identifier not found

There's also in cmath:

1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cmath(31,18): error C2039: 'acosf': is not a member of '`global namespace''
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cmath(31,23): error C3861: 'acosf': identifier not found
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cmath(35,18): error C2039: 'acoshf': is not a member of '`global namespace''
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cmath(35,24): error C3861: 'acoshf': identifier not found

As it is in side Microsoft files I don't see what I can do.

EDIT: If I select "go to definition" in cmath, it seems that all these function are not declared because of _CRT_FUNCTIONS_REQUIRED not beeing defined, maybe it can help.

As the problem ocured after I modified the resource and I found that fabs was not declared because of _CRT_FUNCTIONS_REQUIRED not set to 1, I checked my resource.h file (comming from the original project) and saw that many definition lines where set and one containing #define _CRT_FUNCTIONS_REQUIRED 0 .

I commented out all the lines and uncommented the missing definition, and I was able to compile.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM