How to enable _USE_UNIX98 (Gcc / C ++ v2.96)

I have a C ++ application that works in real compilers (I will compile it using eclipse). Now I need to compile it on a very old version of the compiler (gcc / C ++ v2.96) on Redhat 7.3 with Kdevelop.

When I compile the application, it gives the following error: swprintf uneclared. It is included in the wchar.h header, but I saw this file in the RH7.3 OS and only declared this function if __USE_UNIX98 __USE_ISOC99 was declared.

How to enable __USE_UNIX98?

+4
source share
2 answers

GNU libc , , <features.h>. , <features.h> __USE_UNIX98 .

, , ( ) , -D_GNU_SOURCE . , , , , , , -D_POSIX_C_SOURCE=200112L. , , , /usr/include/features.h.

+3

<features.h>, _XOPEN_SOURCE 500 , __USE_UNIX98

+2

Source: https://habr.com/ru/post/1568024/


All Articles