Math.h is not included even if included in the makefile

I am trying to build SPRO from http://www.irisa.fr/metiss/guig/spro

They use Automake 1.6.2 to create a makefile.

My problem is that when I try to build a project, I get the error

"undefined reference to 'sin' "

etc.

Here is an image of the error

enter image description here

This error is because the math library is not included in the flag -lm

, but is -lm

present inmakefile.am

Here is my makefile.am

AUTOMAKE_OPTIONS = 1.4 foreign

ACLOCAL_AMFLAGS = -I auxdir

LDADD    = -lm -L. -lspro @sphere_lib@
INCLUDES = @sphere_include@

include_HEADERS = spro.h
lib_LIBRARIES = libspro.a
noinst_HEADERS = getopt.h

libspro_a_SOURCES = system.h spro.h sig.c spf.c header.c misc.c lpc.c   convert.c fft.c

bin_PROGRAMS = scopy slpc slpcep sfbank sfbcep
noinst_PROGRAMS = scompare

scopy_SOURCES = scopy.c getopt.c getopt1.c
scopy_DEPENDENCIES = libspro.a

slpc_SOURCES = slpc.c getopt.c getopt1.c
slpc_DEPENDENCIES = libspro.a

slpcep_SOURCES = slpcep.c getopt.c getopt1.c
slpcep_DEPENDENCIES = libspro.a

sfbank_SOURCES = sfbank.c getopt.c getopt1.c
sfbank_DEPENDENCIES = libspro.a

sfbcep_SOURCES = sfbcep.c getopt.c getopt1.c
sfbcep_DEPENDENCIES = libspro.a

scompare_SOURCES = scompare.c getopt.c getopt1.c
scompare_DEPENDENCIES = libspro.a

SUBDIRS = doc auxdir test
EXTRA_DIST = README INSTALL COPYING CHANGES

      

Can anyone help me solve this problem?

+3


source to share


1 answer


Reorder the dependencies (if libA needs symbols from libB then the order should be -lA -lB

). Therefore it should be:



LDADD    = -L. -lspro @sphere_lib@ -lm

      

+6


source







All Articles