<div dir="auto">You need to add the library to the gcc command that links the program. If the libndbm is in the library search path, add -lndbm.<div dir="auto"><br></div><div dir="auto">I don't recall the exact Makefile variable to set for this to show up. Look at the paranoia sample. It should be doing this with -lm.</div><div dir="auto"><br></div><div dir="auto">--joel</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 28, 2019, 8:12 AM Vaibhav Gupta <<a href="mailto:vaibhavgupta40@gmail.com">vaibhavgupta40@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello,</div><div>.<br></div><div>Status:<br></div><div><ol><li>I have ported ndbm in newlib. When compiled newlib-cygwin, function symbols were generated. Created patch.</li><li>Applied the patch to RSB and rebuild toolchain. Generated ndbm.h in 5/sparc-rtems5/include directory.</li></ol><div>Blocker:</div><div><ol><li>I made a raw program which calls dbm_open, dbm_close, dbm_store, dbm_fetch.</li><li>When  I run 'make -j 2', in erc32 directory, it shows undefined reference to those functions.</li></ol><div><a href="https://github.com/VARoDeK/rtems/compare/test_ndbm_presence_02" target="_blank" rel="noreferrer">https://github.com/VARoDeK/rtems/compare/test_ndbm_presence_02</a></div><div>.</div><div>home/varodek/development/rtems/5/lib/gcc/sparc-rtems5/7.4.1/../../../../sparc-rtems5/bin/ld: psxinttypes01/psxinttypes01-init.o: in function `Init':<br>/home/varodek/development/rtems/kernel/rtems/c/src/../../testsuites/psxtests/psxinttypes01/init.c:231: undefined reference to `dbm_open'<br>/home/varodek/development/rtems/5/lib/gcc/sparc-rtems5/7.4.1/../../../../sparc-rtems5/bin/ld: /home/varodek/development/rtems/kernel/rtems/c/src/../../testsuites/psxtests/psxinttypes01/init.c:232: undefined reference to `dbm_store'<br>/home/varodek/development/rtems/5/lib/gcc/sparc-rtems5/7.4.1/../../../../sparc-rtems5/bin/ld: /home/varodek/development/rtems/kernel/rtems/c/src/../../testsuites/psxtests/psxinttypes01/init.c:236: undefined reference to `dbm_fetch'<br>/home/varodek/development/rtems/5/lib/gcc/sparc-rtems5/7.4.1/../../../../sparc-rtems5/bin/ld: /home/varodek/development/rtems/kernel/rtems/c/src/../../testsuites/psxtests/psxinttypes01/init.c:239: undefined reference to `dbm_close'<br>collect2: error: ld returned 1 exit status<br>make[5]: *** [Makefile:7679: psxinttypes01.exe] Error 1<br>make[5]: Leaving directory '/home/varodek/development/rtems/kernel/erc32/sparc-rtems5/c/erc32/testsuites/psxtests'<br>make[4]: *** [Makefile:663: psxtests] Error 2<br>make[4]: *** Waiting for unfinished jobs....<br></div><div>.</div><div>.<br></div><div>.</div><div>Maybe I have compiled it incorrectly, please verify.</div><div><ol><li>ndbm port: <a href="https://github.com/VARoDeK/newlib/compare/port_ndbm" target="_blank" rel="noreferrer">https://github.com/VARoDeK/newlib/compare/port_ndbm</a></li><li>RSB patch: <a href="https://github.com/VARoDeK/rsb/compare/newlib_ndbm_rsb_patch_01" target="_blank" rel="noreferrer">https://github.com/VARoDeK/rsb/compare/newlib_ndbm_rsb_patch_01</a></li></ol><div>Vaibhav Gupta<br></div></div></div></div></div>
</blockquote></div>