Date: Thu, 16 Oct 2014 19:32:00 +0200 From: Gilles Chanteperdrix Message-ID: <20141016173200.GC30661@sisyphus.hd.free.fr> References: <1413460213.12609.YahooMailNeo@web121502.mail.ne1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1413460213.12609.YahooMailNeo@web121502.mail.ne1.yahoo.com> Subject: Re: [Xenomai] undefined reference of rt_timer_read() List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Arsalan Shahid Cc: "xenomai@xenomai.org" On Thu, Oct 16, 2014 at 04:50:13AM -0700, Arsalan Shahid wrote: > Hi Hi, > > I pray that this message finds you in the Best of Health & Happiness Thanks, but you do not need to be so formal, a simple "hi" will do. > I am using NATIVE skin of Xenomai along with OpenMP. Xenomai works > perfectly fine with NATIVE skin when we use it along OpenMP. But > In my codes when ever I tried to access any Function of Native > skin I get an error in compilation. I used rt_timer_read() as > shown below. > > RTIME now; > now = rt_timer_read(); > > code.c:(.text+0x33): undefined reference to `rt_timer_read' > code.c:(.text+0x49): undefined reference to `rt_timer_ticks2ns' I believe the problem to be in the way you compile your program. You should obtain the correct flag with the "xeno-config" program, documented here: http://www.xenomai.org/documentation/xenomai-2.6/html/xeno-config/ Also beware of gcc link order beginners trap: the order of arguments on gcc command line matters: https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html > > Same is the case when I call used rt_printf. Another thing which > comes while compiling Xenomai application occurs when I give > command line option (-lrtdk). Without this code is compiled but > with this it gives error. For -lrtdk, see: http://www.xenomai.org/pipermail/xenomai/2012-January/025149.html Regards. -- Gilles.