matrix_df hotmail wrote: > Hello > > I have a compiling problem, undefined reference to `clock_gettime' and so > on... > with rtnet-0.9.3 and rtnet-0.9.3-svn > > linux 2.6.15.4, xenomai-2.1.0 > ------------------------------------------------------------------ > cd /ue/rtnet-0.9.3-svn/examples/xenomai/posix > > [EMAIL PROTECTED] posix]# make > if gcc -DHAVE_CONFIG_H -I. -I. -I../../../config -s > -I../../../stack/include > -s -MT rtt-sender.o -MD -MP -MF ".deps/rtt-sender.Tpo" -c -o rtt-sender.o > rtt-se > nder.c; \ > then mv -f ".deps/rtt-sender.Tpo" ".deps/rtt-sender.Po"; else rm -f > ".deps/rtt-s > ender.Tpo"; exit 1; fi > /bin/sh ../../../libtool --tag=CC --mode=link gcc -I../../../stack/include > -s > -lpthread -lrtdm -o rtt-sender rtt-sender.o > mkdir .libs > gcc -I../../../stack/include -s -o rtt-sender rtt-sender.o -lpthread -lrtdm > /usr/bin/ld: cannot find -lrtdm > collect2: ld returned 1 exit status > make: *** [rtt-sender] Fehler 1 > > [EMAIL PROTECTED] posix]# export LD_LIBRARY_PATH=/usr/xenomai/lib/
No, this should not be required to get it built. When enabling the example in the RTnet configuration, did you specify the full path of xeno-config? It's not just the path to your Xenomai installation. > > [EMAIL PROTECTED] posix]# make > /bin/sh ../../../libtool --tag=CC --mode=link gcc -I../../../stack/include > -s > -lpthread -lrtdm -o rtt-sender rtt-sender.o > gcc -I../../../stack/include -s -o rtt-sender rtt-sender.o -lpthread > /usr/xenom > ai/lib/librtdm.so -Wl,--rpath -Wl,/usr/xenomai/lib -Wl,--rpath > -Wl,/usr/xenomai/ > lib > rtt-sender.o(.text+0xd9): In function `transmitter': > : undefined reference to `clock_gettime' > rtt-sender.o(.text+0x12b): In function `transmitter': > : undefined reference to `clock_nanosleep' > rtt-sender.o(.text+0x13c): In function `transmitter': > : undefined reference to `clock_gettime' > rtt-sender.o(.text+0x253): In function `receiver': > : undefined reference to `clock_gettime' > rtt-sender.o(.text+0x2d4): In function `receiver': > : undefined reference to `mq_send' > rtt-sender.o(.text+0x2fe): In function `catch_signal': > : undefined reference to `mq_close' > rtt-sender.o(.text+0x66c): In function `main': > : undefined reference to `mq_open' > rtt-sender.o(.text+0x746): In function `main': > : undefined reference to `mq_close' > rtt-sender.o(.text+0x7bd): In function `main': > : undefined reference to `mq_close' > rtt-sender.o(.text+0x828): In function `main': > : undefined reference to `mq_receive' > collect2: ld returned 1 exit status > make: *** [rtt-sender] Fehler 1 > ------------------------------------------------------------------ > > > the same happens if I do it manually: > > ------------------------------------------------------------------ > gcc -c -o rtt-sender.o -I/usr/xenomai/include/ -I/usr/local/ > rtnet-0.9.3-svn/include/ -L/usr/xenomai/lib/ rtt-sender.c > > gcc -o rrt-sender -L/usr/xenomai/lib -lrtdm rtt-sender.o -lp > thread > rtt-sender.o(.text+0xd9): In function `transmitter': > : undefined reference to `clock_gettime' > rtt-sender.o(.text+0x12b): In function `transmitter': > : undefined reference to `clock_nanosleep' > rtt-sender.o(.text+0x13c): In function `transmitter': > : undefined reference to `clock_gettime' > rtt-sender.o(.text+0x253): In function `receiver': > : undefined reference to `clock_gettime' > rtt-sender.o(.text+0x2d4): In function `receiver': > : undefined reference to `mq_send' > rtt-sender.o(.text+0x2fe): In function `catch_signal': > : undefined reference to `mq_close' > rtt-sender.o(.text+0x66c): In function `main': > : undefined reference to `mq_open' > rtt-sender.o(.text+0x746): In function `main': > : undefined reference to `mq_close' > rtt-sender.o(.text+0x7bd): In function `main': > : undefined reference to `mq_close' > rtt-sender.o(.text+0x828): In function `main': > : undefined reference to `mq_receive' > collect2: ld gab 1 als Ende-Status zurück > ------------------------------------------------------------------ > > What did I wrong? When trying to compile the examples "out-of-tree", you have to use the right magic: gcc -o rtt-responder rtt-responder.c `.../xeno-config --posix-cflags` `.../xeno-config --posix-ldflags` -I .../rtnet/include That's basically what the RTnet build system is also doing. Nevertheless, the 2.1 series of Xenomai is lacking a fix we already have in 2.2 (http://svn.gna.org/viewcvs/xenomai?rev=714&view=rev, I will try to get this back-ported ASAP). So you will get a different error even if everything is provided correctly. Fortunately, it can be worked around in RTnet, and I did so in SVN now. Shame on me, I only tested against the "bleeding" edge... Jan PS: If you want to compile rtt-* against normal Linux for comparison, you also have to add "-lrt" to the linker options. This is where clock_realtime&friends are in the glibc. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ RTnet-users mailing list RTnet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rtnet-users