{"id":1641,"date":"2020-06-07T22:22:37","date_gmt":"2020-06-07T14:22:37","guid":{"rendered":"http:\/\/bloo.heing.fun\/?p=1641"},"modified":"2020-06-09T11:09:46","modified_gmt":"2020-06-09T03:09:46","slug":"gcc-xxx-c-lrt","status":"publish","type":"post","link":"https:\/\/bloo.heing.fun\/?p=1641","title":{"rendered":"gcc xxx.c -lrt"},"content":{"rendered":"\n<p>\u8fd9\u4e2a-lrt\u5fc5\u987b\u653e\u5728\u6700\u53f3\u8fb9<\/p>\n\n\n\n<p>-lrt\u8868\u793a\u4f7f\u7528library: librt<\/p>\n\n\n\n<p>\u5728CMakeLists.txt\u4e2d\u6307\u5b9alrt: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>target_link_libraries(helloapp rt)<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>NAME\n     librt, libposix4 - POSIX.1b Realtime Extensions library\n\nSYNOPSIS\n     cc &#91; flag... ] file... -lrt &#91; library... ]\n\nDESCRIPTION\n     Functions in this library provide  most  of  the  interfaces\n     specified  by  the  POSIX.1b  Realtime Extension.  See stan-\n     dards(5). Specifically, this includes the interfaces defined\n     under   the   Asynchronous  I\/O,  Message  Passing,  Process\n     Scheduling, Realtime Signals Extension,  Semaphores,  Shared\n     Memory  Objects,  Synchronized  I\/O, and Timers options. The\n     interfaces defined under the Memory  Mapped  Files,  Process\n     Memory  Locking,  and  Range Memory Locking options are pro-\n     vided in libc(3LIB)\n\n     See the man pages for the individual interfaces  in  section\n     3RT for information on required headers.\n\n     The name libposix4 is maintained for backward  compatibility\n     and  should be avoided. librt is the preferred name for this\n     library.<\/code><\/pre>\n\n\n\n<p>\u5f53\u5728linux\u4e0b\u4f7f\u7528\u4e00\u4e9b\u5e93\uff0c\u5982&lt;sys\/shm.h&gt;\u65f6\uff0c\u9700\u8981\u6307\u5b9a\u8fd9\u4e2a\u9009\u9879<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u4e2a-lrt\u5fc5\u987b\u653e\u5728\u6700\u53f3\u8fb9 -lrt\u8868\u793a\u4f7f\u7528library: librt \u5728CMakeLists.txt\u4e2d\u6307\u5b9a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[76,36],"tags":[],"class_list":["post-1641","post","type-post","status-publish","format-standard","hentry","category-cplusplus","category-36"],"_links":{"self":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts\/1641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1641"}],"version-history":[{"count":3,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts\/1641\/revisions"}],"predecessor-version":[{"id":1656,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts\/1641\/revisions\/1656"}],"wp:attachment":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}