简体   繁体   English

math.h即使包含在makefile中也不包括在内

[英]math.h not being included even when it is included in makefile

I am trying to build SPRO from http://www.irisa.fr/metiss/guig/spro 我正在尝试从http://www.irisa.fr/metiss/guig/spro建立SPRO

They use Automake 1.6.2 to generate the makefile. 他们使用Automake 1.6.2生成makefile。

My issue is that when I am trying to make the project I am getting the error 我的问题是,当我尝试制作项目时,我收到错误

"undefined reference to 'sin' " etc. "undefined reference to 'sin' "

Here is the error image 这是错误图像

在此输入图像描述

This error is due to the fact that math library is not being included with -lm flag but -lm is present in makefile.am 此错误是由于数学库未包含-lm标志但-lm存在于makefile.am

Here is my makefile.am 这是我的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 guide me how to fix this issue? 任何人都可以指导我如何解决这个问题?

Change the order of the dependencies (if libA needs symbols from libB then the order should be -lA -lB ). 更改依赖项的顺序(如果libA需要来自libB的符号,则顺序应为-lA -lB )。 So it should be: 所以它应该是:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM