{"id":312804,"date":"2020-11-09T15:00:36","date_gmt":"2020-11-09T15:00:36","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=312804"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=312804","title":{"rendered":"\u041f\u0438\u0448\u0435\u043c \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421\/C++ \u0432 Linux \u043f\u043e\u0434 KolibriOS"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<h3 id=\"vstuplenie\">\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>KolibriOS \u2013 \u043c\u0438\u043d\u0438\u0430\u0442\u044e\u0440\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u044f\u0434\u0440\u043e \u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435. \u042d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f KolibriOS \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 toolchain&#8217;\u0430 \u0434\u043b\u044f Linux.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h3 id=\"nachnem\">\u041d\u0430\u0447\u043d\u0435\u043c<\/h3>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"http:\/\/ftp.kolibrios.org\/users\/Serge\/new\/Toolchain\/x86_64-linux-kos32-5.4.0.7z\">Toolchain (\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440)<\/a><\/li>\n<li><a href=\"http:\/\/ftp.kolibrios.org\/users\/Serge\/new\/Toolchain\/sdk-28-10-16.7z\">SDK \u0441 FTP (\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438)<\/a><\/li>\n<li>SDK \u0441 SVN<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 \/home\/USER\/autobuild (\u0433\u0434\u0435 USER \u2014 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f). \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0441\u044b\u043b\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">sudo ln -s \/home\/USER\/autobuild \/home\/autobuild<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \/home\/autobuild. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0435\u0440\u0435\u0432\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \/home\/autobuild\/tools\/win32. \u0421\u043a\u0430\u0447\u0430\u0435\u043c \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 toolchain \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u0443\u0435\u043c \u0432 \/home\/autobuild\/tools\/win32. \u0414\u0430\u043b\u0435\u0435 \u0441\u043a\u0430\u0447\u0430\u0435\u043c SDK \u0441 FTP \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u0443\u0435\u043c \u043f\u043e\u0432\u0435\u0440\u0445 \/home\/autobuild\/tools\/win32\/lib \u0438 \/home\/autobuild\/tools\/win32\/mingw32\/lib (\u0432 \u0434\u0432\u0443\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u2014 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 makefile&#8217;\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438 \u0442\u043e\u0442 \u0438 \u0442\u043e\u0442 \u043f\u0443\u0442\u044c). \u0414\u0430\u043b\u0435\u0435 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435.<\/p>\n<p>  <\/p>\n<h3 id=\"skachivanie-svn\">\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 SVN<\/h3>\n<p>  <\/p>\n<p>\u0412\u044b\u0434\u0435\u043b\u0438\u0442\u0435 \u043e\u0434\u043d\u0443 \u043f\u0430\u043f\u043a\u0443. \u042f \u0431\u0443\u0434\u0443 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0435\u0435 \u043a\u0430\u043a \/home\/USER\/KOS_SVN. \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">cd \/home\/USER\/KOS_SVN svn co svn:\/\/kolibrios.org<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c \u043f\u043e\u043a\u0430 \u0432\u044b\u043a\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u0441\u044c SVN.<\/p>\n<p>  <\/p>\n<h3 id=\"podgotovka-k-kompilyacii\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/h3>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u043f\u0430\u043f\u043a\u0435 \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f &quot;PATH&quot; \u0432 \u0444\u0430\u0439\u043b\u0435 &quot;\/etc\/environment&quot;.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">sudo nano \/etc\/environment<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">:\/home\/autobuild\/tools\/win32\/bin<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>libisl<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">wget http:\/\/board.kolibrios.org\/download\/file.php?id=8301libisl.so.10.2.2.7z &amp;&amp; 7z x file.php?id=8301libisl.so.10.2.2.7z  sudo mv libisl.so.10.2.2 \/usr\/lib\/x86_64-linux-gnu &amp;&amp; sudo ln -s \/usr\/lib\/x86_64-linux-gnu\/libisl.so.10.2.2 \/usr\/lib\/x86_64-linux-gnu\/libisl.so.10  sudo chmod go-w \/usr\/lib\/x86_64-linux-gnu\/libisl.so.10 &amp;&amp; sudo chmod go-w \/usr\/lib\/x86_64-linux-gnu\/libisl.so.10.2.2<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430:<br \/>  <strong>\/home\/autobuild\/tools\/win32\/bin\/..\/libexec\/gcc\/mingw32\/5.4.0\/cc1: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory<\/strong><\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u043e\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">sudo ln -s \/usr\/lib\/x86_64-linux-gnu\/libmpfr.so.6 \/usr\/lib\/x86_64-linux-gnu\/libmpfr.so.4<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"kompilyaciya\">\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043b\u0435\u0436\u0430\u0442 \u0432 \/home\/USER\/KOS_SVN\/contrib\/sdk\/samples. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 Cairo. \u0417\u0430\u0439\u0434\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0438 \u0441\u043a\u0430\u0436\u0435\u043c <strong>make<\/strong>. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0443\u0434\u0430\u0447\u043d\u043e, \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a <strong>cairo<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 KolibriOS.<\/p>\n<p>  <\/p>\n<h4 id=\"esche-odin-primer\">\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440<\/h4>\n<p>  <\/p>\n<p><strong>hello.c<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include &lt;kos32sys.h&gt;  char* title = &quot;Window&quot;;  void _draw_window(){     BeginDraw();     DrawWindow(100,100,400,200,title,0x80ffffff,0x13);     EndDraw(); }  int main() {     _draw_window();     for (;;)     {        switch(get_os_event())        {           case 1:              _draw_window();              continue;           case 2:              \/\/ key pressed, read it and ignore              get_key();              continue;           case 3:              \/\/ button pressed; we have only one button, close              if(get_os_button() == 1) return 0;              continue;        }     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0435\u0433\u043e \u043f\u043e\u0439\u0434\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 Makefile (\u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u043d\u0430 tab&#8217;\u044b):<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">CC = kos32-gcc LD = kos32-ld   SDK_DIR:= \/home\/USER\/KOS_SVN\/contrib\/sdk  LDFLAGS = -static -S -nostdlib -T $(SDK_DIR)\/sources\/newlib\/app.lds --image-base 0  CFLAGS = -c -fno-ident -O2 -fomit-frame-pointer -fno-ident -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32  INCLUDES= -I $(SDK_DIR)\/sources\/newlib\/libc\/include LIBPATH:= -L $(SDK_DIR)\/lib -L \/home\/autobuild\/tools\/win32\/mingw32\/lib  SOURCES = hello.c   \\       $(NULL)  OBJECTS =  $(patsubst %.c, %.o, $(SOURCES))  default: hello.kex  hello.kex: $(OBJECTS) Makefile     $(LD) $(LDFLAGS) $(LIBPATH) --subsystem native -o hello.kex $(OBJECTS) -lgcc -lc.dll     objcopy hello.kex -O binary  %.o : %.c Makefile $(SOURCES)     $(CC) $(CFLAGS) $(INCLUDES) -o $@ $&lt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/527144\/\"> https:\/\/habr.com\/ru\/post\/527144\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<h3 id=\"vstuplenie\">\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>KolibriOS \u2013 \u043c\u0438\u043d\u0438\u0430\u0442\u044e\u0440\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u044f\u0434\u0440\u043e \u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435. \u042d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f KolibriOS \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 toolchain&#8217;\u0430 \u0434\u043b\u044f Linux.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-312804","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312804","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=312804"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312804\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=312804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=312804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=312804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}