>> make make all-am make[1]: Entering directory `/home/bob/Documents/Programs/Pwordsaver' gcc -Wall -Wextra -g -O2 -lmhash -o pwordsaver pwordsaver.o fileutil.o pwordsaver.o: In function `dohash': /home/bob/Documents/Programs/Pwordsaver/pwordsaver.c:220: undefined reference to `mhash_init' /home/bob/Documents/Programs/Pwordsaver/pwordsaver.c:226: undefined reference to `mhash' /home/bob/Documents/Programs/Pwordsaver/pwordsaver.c:228: undefined reference to `mhash_deinit' collect2: error: ld returned 1 exit status
However when I alter the gcc line to: gcc -Wall -Wextra -g -O2 -o pwordsaver pwordsaver.o fileutil.o -lmhash and use that command by hand the compilation completes successfully. Here is my Makefile.am AM_CFLAGS=-Wall -Wextra bin_PROGRAMS=pwordsaver pwordsaver_SOURCES=pwordsaver.c fileutil.c fileutil.h AM_LDFLAGS = -lmhash man_MANS=pwordsaver.1 EXTRA_BUILD=pwordsaver.1 This problem seems to be a 'feature' of gcc because the same error happens when compiling by manual commands. What must I do please?