Ich habe das Makefile unten angegeben. Als ich make
erhalte ich die folgenden FehlerMakefile findet keine Header-Datei von -I Include Pfad
cc -c -o timing.o timing.c
test_c.c:5:17: fatal error: test.h: No such file or directory
#include "test.h"
Ich habe manuell verfied dass test.h
in ../include
Pfad vorhanden ist. Ich bin nicht sicher, warum dies nicht den Header file.It zu finden wäre toll, wenn jemand help.Also konnte ich g++
statt cc
# Makefile template for shared library
CXX = g++ # C++ compiler
CXXFLAGS = -fPIC -Wall -Wextra -O2 -g -I../include #CXX flags
LDFLAGS = -lboost_system -shared # linking flags
RM = rm -f # rm command
TARGET_LIB = libtest.a # target lib
C_SRCS := test_a.c test_b.c
CPP_SRCS := test_c.cpp test_d.cpp
OBJS := $(C_SRCS:.c=.o) $(CPP_SRCS:.cpp=.o)
.PHONY: all
all: ${TARGET_LIB}
$(TARGET_LIB): $(OBJS)
$(CXX) $(CXXFLAGS) ${LDFLAGS} -o [email protected] $^
.PHONY: clean
clean:
-${RM} ${TARGET_LIB} ${OBJS}
~
@alvits: Du hast Recht, ich habe diese Korrektur gemacht, als ich deinen Kommentar gesehen habe. – Beta