关于库的Makefile错误

时间:2013-09-08 14:51:19

标签: c++ c compiler-construction makefile

我一直在尝试通过make命令编译一些代码。在这种情况下,我得到关于查找“-lboost_program_options”的错误。 当我正在研究Makefile时,我发现第29行有一些需要,我必须要有这些需求,当我有那些我必须放置它们的时候好吗?任何人都可以帮助我吗?

错误:

g++ src/*.o  -o cbir -lboost_program_options -lhdf5 -lboost_filesystem -lboost_system -llog4cxx -lflann
c:/mingw/bin/../lib/gcc/mingw32/4.3.3/../../../../mingw32/bin/ld.exe: cannot find -lboost_program_options collect2: ld returned 1 exit status
Makefile:29: recipe for target `cbir' failed
make: *** [cbir] Error 1

生成文件:

# Compiler flags
CC=g++
CFLAGS= -I. -Iflann/src/cpp
# Class name
CLASS=cse484

# Project name
PROJECT=project

# MSU aPID
aPID=riggleza-vanweime

# OBJ Files...
OBJ=$(patsubst %.cpp,%.o,$(wildcard src/*.cpp))

# Output File...
OUTPUT_FILE = cbir

# Source dir
SRC = src

# Include dir
INC = inc

all: $(OBJ) cbir 


cbir: $(OBJ)
    $(CC) $(SRC)/*.o $(FLAGS) -o $(OUTPUT_FILE) -lboost_program_options -lhdf5 -lboost_filesystem  lboost_system -llog4cxx -lflann

clean:
    rm -f $(SRC)/*.o $(OUTPUT_FILE) $(CLASS)-$(PROJ)-$(aPID)*.tar.gz

dist: clean
        tar -cvzf $(CLASS)-$(PROJECT)-$(aPID).tar.gz *

dist-final: clean
    astyle --style=kr *.cpp *.h
    rm -f *.orig
    tar -cvzf $(CLASS)-$(PROJ)-$(aPID).final.tar.gz *

%.o: %.cpp
    $(CC) $(CFLAGS) -c -o $*.o $*.cpp

0 个答案:

没有答案