automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Generated Makefile fails to build


From: Robert Parker
Subject: Generated Makefile fails to build
Date: Sat, 20 Sep 2014 03:26:30 +0700

>> 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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]