{"id":14122,"date":"2023-06-30T15:52:04","date_gmt":"2023-06-30T15:52:04","guid":{"rendered":"https:\/\/blog.bachi.net\/?p=14122"},"modified":"2023-06-30T16:11:29","modified_gmt":"2023-06-30T16:11:29","slug":"xrdp-on-rhel-7-9","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=14122","title":{"rendered":"xrdp on RHEL 7.9"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/neutrinolabs\/xrdp\/issues\/2156\">compile error with xrdp version 0.9.18.1 on CentOS 7 #2156<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/56350544\/implicit-declaration-of-function-gmtime-r\"><\/a><br \/>\n<a href=\"https:\/\/github.com\/zephyrproject-rtos\/zephyr\/issues\/24730\">C standard library <time.h> functions and structures not available when using POSIX API<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ CFLAGS=-std=gnu99 .\/configure --prefix=\/app\/xrdp\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\n#define __USE_GNU\r\n#define __USE_POSIX \r\n\r\nsession.c:32:0: error: &quot;__USE_GNU&quot; redefined &#x5B;-Werror]\r\n #define __USE_GNU\r\n ^\r\n&lt;command-line&gt;:0:0: note: this is the location of the previous definition\r\nsession.c:33:0: error: &quot;__USE_POSIX&quot; redefined &#x5B;-Werror]\r\n #define __USE_POSIX\r\n\r\n\r\n# ifdef __USE_GNU\r\nextern char *strptime_l (const char *__restrict __s,\r\n                         const char *__restrict __fmt, struct tm *__tp,\r\n                         __locale_t __loc) __THROW;\r\n# endif\r\n\r\n# if defined __USE_POSIX || defined __USE_MISC\r\n\/* Return the `struct tm' representation of *TIMER in UTC,\r\n   using *TP to store the result.  *\/\r\nextern struct tm *gmtime_r (const time_t *__restrict __timer,\r\n                            struct tm *__restrict __tp) __THROW;\r\n\r\n\/* Return the `struct tm' representation of *TIMER in local time,\r\n   using *TP to store the result.  *\/\r\nextern struct tm *localtime_r (const time_t *__restrict __timer,\r\n                               struct tm *__restrict __tp) __THROW;\r\n# endif \/* POSIX or misc *\/\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nmake&#x5B;2]: Entering directory `\/home\/andreas\/xrdp-0.9.22.1\/common'\r\n  CC       base64.lo\r\n  CC       fifo.lo\r\n  CC       file.lo\r\n  CC       guid.lo\r\nguid.c: In function 'guid_new':\r\nguid.c:36:12: error: missing braces around initializer &#x5B;-Werror=missing-braces]\r\n     struct guid guid = {0};\r\n            ^\r\nguid.c:36:12: error: (near initialization for 'guid.g') &#x5B;-Werror=missing-braces]\r\ncc1: all warnings being treated as errors\r\nmake&#x5B;2]: *** &#x5B;guid.lo] Error 1\r\nmake&#x5B;2]: Leaving directory `\/home\/andreas\/xrdp-0.9.22.1\/common'\r\nmake&#x5B;1]: *** &#x5B;all-recursive] Error 1\r\nmake&#x5B;1]: Leaving directory `\/home\/andreas\/xrdp-0.9.22.1'\r\nmake: *** &#x5B;all] Error 2\r\n\r\n\r\nmake&#x5B;3]: Entering directory `\/home\/andreas\/xrdp-0.9.22.1\/sesman\/chansrv'\r\n  CC       chansrv.o\r\n  CC       chansrv_common.o\r\n  CC       chansrv_config.o\r\n  CC       chansrv_fuse.o\r\n  CC       chansrv_xfs.o\r\n  CC       clipboard.o\r\n  CC       clipboard_file.o\r\n  CC       devredir.o\r\n  CC       fifo.o\r\n  CC       irp.o\r\n  CC       rail.o\r\n  CC       smartcard.o\r\n  CC       smartcard_pcsc.o\r\n  CC       sound.o\r\nsound.c: In function \u2018process_pcm_message\u2019:\r\nsound.c:1121:21: error: \u2018for\u2019 loop initial declarations are only allowed in C99 mode\r\n                     for (int i = 0; i &lt; send_silence_times; i++)\r\n                     ^\r\nsound.c:1121:21: note: use option -std=c99 or -std=gnu99 to compile your code\r\nmake&#x5B;3]: *** &#x5B;sound.o] Error 1\r\nmake&#x5B;3]: Leaving directory `\/home\/andreas\/xrdp-0.9.22.1\/sesman\/chansrv'\r\nmake&#x5B;2]: *** &#x5B;all-recursive] Error 1\r\nmake&#x5B;2]: Leaving directory `\/home\/andreas\/xrdp-0.9.22.1\/sesman'\r\nmake&#x5B;1]: *** &#x5B;all-recursive] Error 1\r\nmake&#x5B;1]: Leaving directory `\/home\/andreas\/xrdp-0.9.22.1'\r\nmake: *** &#x5B;all] Error 2\r\n\r\n\r\n\r\n\r\nmake&#x5B;3]: Entering directory `\/home\/andreas\/xrdp-0.9.22.1\/sesman'\r\n  CC       access.o\r\n  CC       config.o\r\n  CC       env.o\r\n  CC       scp.o\r\n  CC       scp_v0.o\r\n  CC       scp_v1.o\r\n  CC       scp_v1_mng.o\r\n  CC       sesman.o\r\n  CC       session.o\r\nsession.c: In function \u2018session_start_fork\u2019:\r\nsession.c:981:9: error: implicit declaration of function \u2018localtime_r\u2019 &#x5B;-Werror=implicit-function-declaration]\r\n         localtime_r(&amp;ltime, &amp;stime);\r\n         ^\r\ncc1: all warnings being treated as errors\r\nmake&#x5B;3]: *** &#x5B;session.o] Error 1\r\nmake&#x5B;3]: Leaving directory `\/home\/andreas\/xrdp-0.9.22.1\/sesman'\r\nmake&#x5B;2]: *** &#x5B;all-recursive] Error 1\r\nmake&#x5B;2]: Leaving directory `\/home\/andreas\/xrdp-0.9.22.1\/sesman'\r\nmake&#x5B;1]: *** &#x5B;all-recursive] Error 1\r\nmake&#x5B;1]: Leaving directory `\/home\/andreas\/xrdp-0.9.22.1'\r\nmake: *** &#x5B;all] Error 2\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8211;prefix=\/app\/xrdp #define __USE_GNU #define __USE_POSIX session.c:32:0: error: &quot;__USE_GNU&quot; redefined &#x5B;-Werror] #define __USE_GNU ^ &lt;command-line&gt;:0:0: note: this is the location of the previous definition session.c:33:0: error: &quot;__USE_POSIX&quot; redefined &#x5B;-Werror] #define __USE_POSIX [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-14122","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/14122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14122"}],"version-history":[{"count":5,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/14122\/revisions"}],"predecessor-version":[{"id":14127,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/14122\/revisions\/14127"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}