xrdp on RHEL 7.9

compile error with xrdp version 0.9.18.1 on CentOS 7 #2156

C standard library functions and structures not available when using POSIX API

$ CFLAGS=-std=gnu99 ./configure --prefix=/app/xrdp

#define __USE_GNU
#define __USE_POSIX 

session.c:32:0: error: "__USE_GNU" redefined [-Werror]
 #define __USE_GNU
 ^
<command-line>:0:0: note: this is the location of the previous definition
session.c:33:0: error: "__USE_POSIX" redefined [-Werror]
 #define __USE_POSIX


# ifdef __USE_GNU
extern char *strptime_l (const char *__restrict __s,
                         const char *__restrict __fmt, struct tm *__tp,
                         __locale_t __loc) __THROW;
# endif

# if defined __USE_POSIX || defined __USE_MISC
/* Return the `struct tm' representation of *TIMER in UTC,
   using *TP to store the result.  */
extern struct tm *gmtime_r (const time_t *__restrict __timer,
                            struct tm *__restrict __tp) __THROW;

/* Return the `struct tm' representation of *TIMER in local time,
   using *TP to store the result.  */
extern struct tm *localtime_r (const time_t *__restrict __timer,
                               struct tm *__restrict __tp) __THROW;
# endif /* POSIX or misc */
make[2]: Entering directory `/home/andreas/xrdp-0.9.22.1/common'
  CC       base64.lo
  CC       fifo.lo
  CC       file.lo
  CC       guid.lo
guid.c: In function 'guid_new':
guid.c:36:12: error: missing braces around initializer [-Werror=missing-braces]
     struct guid guid = {0};
            ^
guid.c:36:12: error: (near initialization for 'guid.g') [-Werror=missing-braces]
cc1: all warnings being treated as errors
make[2]: *** [guid.lo] Error 1
make[2]: Leaving directory `/home/andreas/xrdp-0.9.22.1/common'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/andreas/xrdp-0.9.22.1'
make: *** [all] Error 2


make[3]: Entering directory `/home/andreas/xrdp-0.9.22.1/sesman/chansrv'
  CC       chansrv.o
  CC       chansrv_common.o
  CC       chansrv_config.o
  CC       chansrv_fuse.o
  CC       chansrv_xfs.o
  CC       clipboard.o
  CC       clipboard_file.o
  CC       devredir.o
  CC       fifo.o
  CC       irp.o
  CC       rail.o
  CC       smartcard.o
  CC       smartcard_pcsc.o
  CC       sound.o
sound.c: In function ‘process_pcm_message’:
sound.c:1121:21: error: ‘for’ loop initial declarations are only allowed in C99 mode
                     for (int i = 0; i < send_silence_times; i++)
                     ^
sound.c:1121:21: note: use option -std=c99 or -std=gnu99 to compile your code
make[3]: *** [sound.o] Error 1
make[3]: Leaving directory `/home/andreas/xrdp-0.9.22.1/sesman/chansrv'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/andreas/xrdp-0.9.22.1/sesman'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/andreas/xrdp-0.9.22.1'
make: *** [all] Error 2




make[3]: Entering directory `/home/andreas/xrdp-0.9.22.1/sesman'
  CC       access.o
  CC       config.o
  CC       env.o
  CC       scp.o
  CC       scp_v0.o
  CC       scp_v1.o
  CC       scp_v1_mng.o
  CC       sesman.o
  CC       session.o
session.c: In function ‘session_start_fork’:
session.c:981:9: error: implicit declaration of function ‘localtime_r’ [-Werror=implicit-function-declaration]
         localtime_r(&ltime, &stime);
         ^
cc1: all warnings being treated as errors
make[3]: *** [session.o] Error 1
make[3]: Leaving directory `/home/andreas/xrdp-0.9.22.1/sesman'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/andreas/xrdp-0.9.22.1/sesman'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/andreas/xrdp-0.9.22.1'
make: *** [all] Error 2

Leave a Reply

Your email address will not be published. Required fields are marked *