you need to add -lcobalt -L/usr/xenomai/lib
. This is needed because WriteFile.o
directly uses rt_fprintf()
, which is not provided by libbela
(as the latter relies on libcobalt
for it). What confuses me is that the error in your case seems to come from libbela.so
:
/usr/bin/ld: /root/Bela/lib/libbela.so: undefined reference to symbol 'rt_fprintf'
but libbela
should know where to find that symbol. If I ldd /root/Bela/lib/libbela.so
I get:
linux-vdso.so.1 (0xbef98000)
libcobalt.so.2 => /usr/xenomai/lib/libcobalt.so.2 (0xb6f31000)
libmodechk.so.0 => /usr/xenomai/lib/libmodechk.so.0 (0xb6f1f000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6efb000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6ee5000)
libprussdrv.so => /usr/local/lib/libprussdrv.so (0xb6ed2000)
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6dc6000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6d4e000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6d25000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6c37000)
/lib/ld-linux-armhf.so.3 (0xb6f89000)
so you see it already knows about using libcobalt
.
The proper fix to this would be to have a Bela_printf
and Bela_fprintf
functions in libbela
that simply wrap rt_printf
and rt_fprintf
, but for now you should just be able to use the fix above.
EDIT:
Also, important: the order of the elements on the command line is important. Place all the .o
files before the -l...
libraries