BigInt라는 라이브러리를 사용하여 프로젝트를 만들려고합니다. 내 파일 구조는 다음과 같습니다Make : 헤더 파일을 만드는 규칙이 없습니까?
/Users/wen/Projects/challenge/fibonacci3/fibonacci3.cpp
/Users/wen/Projects/challenge/fibonacci3/Makefile
/Users/wen/Projects/include/bigint/<.cc files and .hh files>
/Users/wen/Projects/include/bigint/Makefile
Fibonacci3 메이크
LD_FLAGS =
CC_FLAGS =
# Include libraries
include /Users/wen/Projects/include/bigint/Makefile
# Build object files
%.o: %.cc %.cpp $(library-cpp)
g++ -c -o [email protected] $(CC_FLAGS)
# Link object files
fibonacci3: fibonacci3.o $(library-objects)
g++ -o [email protected] $(LD_FLAGS)
의로하고 BIGINT 메이크 (단축)
# Mention default target.
all:
# Implicit rule to compile C++ files. Modify to your taste.
%.o: %.cc
g++ -c -O2 -Wall -Wextra -pedantic $<
# Components of the library.
library-cpp = \
BigUnsigned.cc \
BigInteger.cc \
BigIntegerAlgorithms.cc \
BigUnsignedInABase.cc \
BigIntegerUtils.cc \
library-objects = \
BigUnsigned.o \
BigInteger.o \
BigIntegerAlgorithms.o \
BigUnsignedInABase.o \
BigIntegerUtils.o \
library-headers = \
NumberlikeArray.hh \
BigUnsigned.hh \
BigInteger.hh \
BigIntegerAlgorithms.hh \
BigUnsignedInABase.hh \
BigIntegerLibrary.hh \
그러나, make
보고서로있다가 수 없음 헤더 파일에 대한 규칙을 찾으십니까?
여기 무슨 일입니까? 헤더는 컴파일되지 않고 포함되어야합니다. 그렇다면 왜 헤더를 요구합니까?
미리 감사드립니다.
솔루션 :
이대신 메이크 등의 내 자신의 메이크 파일에 소스를 컴파일합니다. 그것은 효과가있다! 다시 한번 감사드립니다.
아, 맞습니다. 그것이 문제였습니다. 고맙습니다! –