$ tar xvfz gdbm-1.8.0.tar.gz $ cd gdbm-1.8.0 $ ./configure $ make $ make progs (snip) creating testndbm cp ./testndbm.c ./tndbm.c gcc -c -I. -I. -O ./tndbm.c rm -f ./tndbm.c gcc -o tndbm tndbm.o -lc tndbm.o: In function `main': tndbm.o(.text+0x108): the `gets' function is dangerous and should not be used. tndbm.o(.text+0x55): undefined reference to `dbm_open' tndbm.o(.text+0x146): undefined reference to `dbm_fetch' tndbm.o(.text+0x215): undefined reference to `dbm_store' tndbm.o(.text+0x292): undefined reference to `dbm_delete' tndbm.o(.text+0x2d2): undefined reference to `dbm_firstkey' tndbm.o(.text+0x312): undefined reference to `dbm_fetch' tndbm.o(.text+0x366): undefined reference to `dbm_nextkey' tndbm.o(.text+0x3a6): undefined reference to `dbm_fetch' tndbm.o(.text+0x404): undefined reference to `dbm_firstkey' tndbm.o(.text+0x42d): undefined reference to `dbm_nextkey' tndbm.o(.text+0x4d5): undefined reference to `dbm_close' collect2: ld returned 1 exit status make: *** [tndbm] エラー 1 |
tndbm: tndbm.o
$(CC) $(LDFLAGS) -o tndbm tndbm.o $(LIBS) -lgdbm
‾‾‾‾‾‾ 追加
|
$ make progs gcc -o tdbm testdbm.o -lc testdbm.o: In function `main': testdbm.o(.text+0x118): the `gets' function is dangerous and should not be used. testdbm.o(.text+0x4e): undefined reference to `dbminit' testdbm.o(.text+0x7d): undefined reference to `dbminit' testdbm.o(.text+0x152): undefined reference to `fetch' testdbm.o(.text+0x20d): undefined reference to `store' testdbm.o(.text+0x280): undefined reference to `delete' testdbm.o(.text+0x2b3): undefined reference to `firstkey' testdbm.o(.text+0x2ef): undefined reference to `fetch' testdbm.o(.text+0x34a): undefined reference to `nextkey' testdbm.o(.text+0x386): undefined reference to `fetch' testdbm.o(.text+0x3e5): undefined reference to `firstkey' testdbm.o(.text+0x40f): undefined reference to `nextkey' collect2: ld returned 1 exit status make: *** [tdbm] エラー 1 |
$ su # make install # make install-compat # exit |