<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:바탕;
panose-1:2 3 6 0 0 1 1 1 1 1;}
@font-face
{font-family:굴림;
panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"맑은 고딕";
panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@굴림";
panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
{font-family:"\@맑은 고딕";}
@font-face
{font-family:"\@바탕";
panose-1:2 3 6 0 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:굴림;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:굴림;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:굴림;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"맑은 고딕";
color:#1F497D;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"맑은 고딕";
color:windowtext;}
span.EmailStyle21
{mso-style-type:personal-compose;
font-family:"맑은 고딕";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:3.0cm 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=KO link=blue vlink=purple><div class=WordSection1><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>Hi,<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>I succeed to use powf function in another function without any touch on hello example of rtems-exampls-v2.<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>I configured RTEMS-4.12 for i386 and use pc386 BSP.<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>My command for configuration is:<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'> $ configure --target-i386-rtems4.12 --enable-bsp=pc386 --enable-posix --enable-networking<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>I use rtems-source-builder for building RTEMS tool sets.<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>And hello example codes are as below.<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>/*<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'> * Classic API Hello World<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'> */<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>#include <rtems.h><o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>#include <stdlib.h><o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>#include <stdio.h><o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>#include <math.h><o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>void another_func(void){<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'> printf( "powf: %f\n", powf(0.2, 4));<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>}<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>rtems_task Init(<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'> rtems_task_argument ignored<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>)<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>{<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'> printf( "\n\n*** HELLO WORLD TEST ***\n" );<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'> printf( "Hello World\n" );<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'> printf( "*** END OF HELLO WORLD TEST ***\n" );<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'> another_func();<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'> exit( 0 );<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>}<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>/* configuration information */<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>#include <bsp.h><o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>/* NOTICE: the clock driver is explicitly disabled */<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>#define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>#define CONFIGURE_RTEMS_INIT_TASKS_TABLE<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>#define CONFIGURE_MAXIMUM_TASKS 1<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>#define CONFIGURE_INIT<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>#include <rtems/confdefs.h><o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>/* end of file */<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>I hope that these will help you.<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'>Jin-Hyun<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕"'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> users [mailto:users-bounces@rtems.org] <b>On Behalf Of </b></span><span style='font-size:11.0pt'>김찬</span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'><br><b>Sent:</b> Sunday, November 13, 2016 10:54 PM<br><b>To:</b> joel@rtems.org<br><b>Cc:</b> rtems-users@rtems.org <users@rtems.org><br><b>Subject:</b> RE: how to use powf or ceilingf function in rtems..<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>Thanks, Joel,<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>I added the </span><span style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>‘<span lang=EN-US>-lm</span>’<span lang=EN-US> option using XCFLAGS variable (which should be extra compile flags).<o:p></o:p></span></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>So the </span><span style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>‘<span lang=EN-US>-lm</span>’<span lang=EN-US> option was given to the compile command (-c) only and was not being given to the link command. So I added </span>–<span lang=EN-US>lm option at the end of COBJS list in my Makefile.base (which my Makefile includes).<o:p></o:p></span></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>I tried using XLDCONFIGS but it didn</span><span style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>’<span lang=EN-US>t</span>’<span lang=EN-US> work I don</span>’<span lang=EN-US>t know why.<o:p></o:p></span></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>Thanks!<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>Chan <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Joel Sherrill [<a href="mailto:joel@rtems.org">mailto:joel@rtems.org</a>] <br><b>Sent:</b> Saturday, November 12, 2016 11:37 PM<br><b>To:</b> </span><span style='font-size:11.0pt'>김찬</span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> <<a href="mailto:ckim@etri.re.kr">ckim@etri.re.kr</a>><br><b>Cc:</b> <a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a> <<a href="mailto:users@rtems.org">users@rtems.org</a>><br><b>Subject:</b> Re: how to use powf or ceilingf function in rtems..<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p><span lang=EN-US>On Nov 12, 2016 4:44 AM, "</span>김찬<span lang=EN-US>" <<a href="mailto:ckim@etri.re.kr">ckim@etri.re.kr</a>> wrote:<br>><br>> Hello,<br>><br>> I</span>’<span lang=EN-US>m trying to make an rtems application which uses some math function.<br>><br>> I put #include <math.h>. When the powf function is in the Init() function, it works,<br>><br>> But when powf is called from another function(I want to call this function from Init..), I get </span>‘<span lang=EN-US>undefined reference to powf</span>’<span lang=EN-US> error.<br>><br>> I tried merning the files into one but it is the same. What can be the problem?<o:p></o:p></span></p><p><span lang=EN-US>You should only have to include math.h and link against libm. There should be nothing odd.<o:p></o:p></span></p><p><span lang=EN-US>My first guess is that the -lm argument is before the other .o on the link command.<o:p></o:p></span></p><p><span lang=EN-US>Check that and if that isn't it, can you produce an example?<o:p></o:p></span></p><p><span lang=EN-US>> Thanks!<br>><br>> Chan Kim<br>><br>> <br>><br>> </span>김 찬<span lang=EN-US> (Chan Kim)<br>><br>> </span>책임연구원<span lang=EN-US>, </span>프로세서연구실<span lang=EN-US>, </span>지능형반도체연구부<span lang=EN-US><br>><br>> </span>한국전자통신연구원<span lang=EN-US><br>><br>> O) 042-860-5773 C) 010-3418-9152 E) <a href="mailto:ckim@etri.re.kr">ckim@etri.re.kr</a><br>><br>> <br>><br>><br>> _______________________________________________<br>> users mailing list<br>> <a href="mailto:users@rtems.org">users@rtems.org</a><br>> <a href="http://lists.rtems.org/mailman/listinfo/users">http://lists.rtems.org/mailman/listinfo/users</a><o:p></o:p></span></p></div></body></html>