<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Jan 24, 2017 12:55 AM, "Tanu Hari Dixit" <<a href="mailto:tokencolour@gmail.com">tokencolour@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hello Devs,<br><br>I have been trying to setup a makefile so as to 
execute the various code snippets given in the C User's guide for RTEMS (<a href="https://docs.rtems.org/doc-current/share/rtems/html/c_user/index.html#SEC_Contents" target="_blank">https://docs.rtems.org/doc-cu<wbr>rrent/share/rtems/html/c_user/<wbr>index.html#SEC_Contents</a>) and have failed miserably. Can you please help me with this?<br></div><br>I have made a file with the first example of printing object names (<a href="https://docs.rtems.org/doc-current/share/rtems/html/c_user/Key-Concepts-Object-Names.html#Key-Concepts-Object-Names" target="_blank">https://docs.rtems.org/doc-cu<wbr>rrent/share/rtems/html/c_user/<wbr>Key-Concepts-Object-Names.<wbr>html#Key-Concepts-Object-Names</a><wbr>) and i use the following command to use sparc-rtems4.12-gcc to compile this program<br><br>sparc-rtems4.12-gcc --pipe -B/home/thd/development/rtems/<wbr>src/builds/erc32_1/sparc-rtems<wbr>4.12/erc32/lib -specs bsp_specs -qrtems -Wall -g -O2 -o rtems_object_try rtems_object_try.c <br><br></div>but when i do ./rtems_object_try I get:<br><br><div>./rtems_object_try: Invalid argument<br></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">The error is correct if the I'd passed into the method doesn't correspond to an object that has been created. This is an example of a helper function and would normally be part of a larger application.</div><div dir="auto"><br></div><div dir="auto">If you called it during the initialization of ticker and passed in a task ID, it should work.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>I narrowed in on the above compiler command by reading the makefile as given here(<a href="https://github.com/alanc98/rki/blob/master/Makefile" target="_blank">https://github.com/alanc9<wbr>8/rki/blob/master/Makefile</a>). <br></div><div><br></div><div>What is it that I am missing? <br><br></div><div>Also is it necessary to use sparc-rtems4.12-gcc and not the gcc available to me normally on my machine. When I use gcc, <br></div><div>I get the following error:<br><br><br>thd@thd-Inspiron-5537:~/develo<wbr>pment/rtems/src/programs/<wbr>rtems_object$ gcc --pipe -B/home/thd/development/rtems/<wbr>src/builds/erc32_1/sparc-rtems<wbr>4.12/erc32/lib -specs bsp_specs -qrtems -Wall -g -O2 -o rtems_object_try rtems_object_try.c <br>In file included from /home/thd/development/rtems/sr<wbr>c/builds/erc32_1/sparc-rtems4.<wbr>12/erc32/lib/include/rtems/<wbr>score/object.h:26:0,<br>                 from /home/thd/development/rtems/sr<wbr>c/builds/erc32_1/sparc-rtems4.<wbr>12/erc32/lib/include/rtems/<wbr>score/thread.h:30,<br>                 from /home/thd/development/rtems/sr<wbr>c/builds/erc32_1/sparc-rtems4.<wbr>12/erc32/lib/include/rtems/<wbr>score/heap.h:22,<br>                 from /home/thd/development/rtems/sr<wbr>c/builds/erc32_1/sparc-rtems4.<wbr>12/erc32/lib/include/rtems/<wbr>rtems/types.h:26,<br>                 from /home/thd/development/rtems/sr<wbr>c/builds/erc32_1/sparc-rtems4.<wbr>12/erc32/lib/include/rtems.h:<wbr>31,<br>                 from rtems_object_try.c:1:<br>/home/thd/development/rtems/sr<wbr>c/builds/erc32_1/sparc-rtems4.<wbr>12/erc32/lib/include/rtems/<wbr>score/rbtree.h:21:22: fatal error: sys/tree.h: No such file or directory<br> #include <sys/tree.h><br>                      ^<br>compilation terminated.<br><br></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">You can't use the native compiler on RTEMS examples except for some POSIX API examples and tests which are constructed to run both on RTEMS and the native host. But they aren't tested often. In the native mode.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br><br></div><div>I am not able to understand what is wrong. It would be great if you could point that out.<br></div><div>Thank you,<br></div>Tanu Hari Dixit.</div>
<br>______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br></blockquote></div><br></div></div></div>