当前位置: 技术问答>linux和unix
makefile链接库问题
来源: 互联网 发布时间:2017-05-11
本文导语: lanet源程序中的makefile文件,make之后提示如下distribute_components.cpp:243: more undefined references to `gsl_rng_uniform' follow,找不到定义。但是我链接库已经制定了,环境变量也设置了,问题在哪呢。 makefile: #C++ GCC=g++ VPATH=src...
lanet源程序中的makefile文件,make之后提示如下distribute_components.cpp:243: more undefined references to `gsl_rng_uniform' follow,找不到定义。但是我链接库已经制定了,环境变量也设置了,问题在哪呢。
makefile:
#C++
GCC=g++
VPATH=src
OBJ=obj
#All relevant -I options here
INCLUDES= -I src
#Add other options for ocamlc here
CFLAGS=-O5 $(INCLUDES) -g -lgsl -lblas
#There must be one line per program
PROGRAM_OBJS=types.o uniform.o graph_builder.o graph_builder_txt.o graph_node_names.o graph_node_colors.o log.o vertex.o graph_kcores.o graph_kcores_components.o graph_kdenses.o graph_kdenses_components.o graph_of_triangles.o graph_triangled_kcores.o graph.o clique.o connectedcomponent.o connectivity.o network.o kcores_component.o kdenses_component.o parameters.o povray_renderer.o svg_renderer.o povray.o svg.o graphics_kcores.o graphics_kdenses.o ff_routine.o distribute_components.o utils.o main.o
#move must be at the end
all: deldoc lanet
lanet: $(PROGRAM_OBJS)
@echo Linking $@...
@$(GCC) -o $@ $(CFLAGS) $+
deldoc:
@rm -r -f doc/
#Common rules
.SUFFIXES: .cpp .o
.cpp.o:
@echo Compiling $
makefile:
#C++
GCC=g++
VPATH=src
OBJ=obj
#All relevant -I options here
INCLUDES= -I src
#Add other options for ocamlc here
CFLAGS=-O5 $(INCLUDES) -g -lgsl -lblas
#There must be one line per program
PROGRAM_OBJS=types.o uniform.o graph_builder.o graph_builder_txt.o graph_node_names.o graph_node_colors.o log.o vertex.o graph_kcores.o graph_kcores_components.o graph_kdenses.o graph_kdenses_components.o graph_of_triangles.o graph_triangled_kcores.o graph.o clique.o connectedcomponent.o connectivity.o network.o kcores_component.o kdenses_component.o parameters.o povray_renderer.o svg_renderer.o povray.o svg.o graphics_kcores.o graphics_kdenses.o ff_routine.o distribute_components.o utils.o main.o
#move must be at the end
all: deldoc lanet
lanet: $(PROGRAM_OBJS)
@echo Linking $@...
@$(GCC) -o $@ $(CFLAGS) $+
deldoc:
@rm -r -f doc/
#Common rules
.SUFFIXES: .cpp .o
.cpp.o:
@echo Compiling $