我一直在尝试通过 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