Makefile: recipe for target 'foo.o' failed
I have a C++ package I wish to compile. It contains the following
Coordinate.h
Coordinate.cpp
Hitbox.h
Hitbox.cpp
Octree.h
Octree.cpp
main.cpp
Main includes all header files. Octree has a dependency on Hitbox.h and Coordinate.h, and Hitbox inherits from Coordinate.h
My make file is as follow:
ARTIFACT = main
#Build architecture/variant string, possible values: x86, armv7le, etc...
PLATFORM ?= x86_64
#Build profile, possible values: release, debug, profile, coverage
BUILD_PROFILE ?= debug
CONFIG_NAME ?= $(PLATFORM)-$(BUILD_PROFILE)
OUTPUT_DIR = build/$(CONFIG_NAME)
TARGET = $(OUTPUT_DIR)/$(ARTIFACT)
#Compiler definitions
CC = qcc -Vgcc_nto$(PLATFORM)
CXX = qcc -lang-c++ -Vgcc_nto$(PLATFORM)
LD = $(CXX)
#User defined include/preprocessor flags and libraries
INCLUDES += -$(OUTPUT_DIR)/src/Coordinate.h
INCLUDES += -$(OUTPUT_DIR)/src/Hitbox.h
INCLUDES += -$(OUTPUT_DIR)/src/Octree.h
LIBS += -$(OUTPUT_DIR)/src/Coordinate.cpp
LIBS += -$(OUTPUT_DIR)/src/Hitbox.cpp
LIBS += -$(OUTPUT_DIR)/src/Octree.cpp
#LIBS += -L../mylib/$(OUTPUT_DIR) -lmylib
#Compiler flags for build profiles
CCFLAGS_release += -O2
CCFLAGS_debug += -g -O0 -fno-builtin
CCFLAGS_coverage += -g -O0 -ftest-coverage -fprofile-arcs -nopipe -Wc,-auxbase-strip,$@
LDFLAGS_coverage += -ftest-coverage -fprofile-arcs
CCFLAGS_profile += -g -O0 -finstrument-functions
LIBS_profile += -lprofilingS
#Generic compiler flags (which include build type flags)
CCFLAGS_all += -Wall -fmessage-length=0
CCFLAGS_all += $(CCFLAGS_$(BUILD_PROFILE))
#Shared library has to be compiled with -fPIC
#CCFLAGS_all += -fPIC
LDFLAGS_all += $(LDFLAGS_$(BUILD_PROFILE))
LIBS_all += $(LIBS_$(BUILD_PROFILE))
DEPS = -Wp,-MMD,$(@:%.o=%.d),-MT,$@
#Macro to expand files recursively: parameters $1 - directory, $2 - extension, i.e. cpp
rwildcard = $(wildcard $(addprefix $1/*.,$2)) $(foreach d,$(wildcard $1/*),$(call rwildcard,$d,$2))
#Source list
SRCS = $(call rwildcard, src, c cpp)
#Object files list
OBJS = $(addprefix $(OUTPUT_DIR)/,$(addsuffix .o, $(basename $(SRCS))))
#Compiling rule
$(OUTPUT_DIR)/%.o: %.c
@mkdir -p $(dir $@)
$(CC) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $<
$(OUTPUT_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $<
#Linking rule
$(TARGET):$(OBJS)
$(LD) -o $(TARGET) $(LDFLAGS_all) $(LDFLAGS) $(OBJS) $(LIBS_all) $(LIBS)
#Rules section for default compilation and linking
all: $(TARGET)
clean:
rm -fr $(OUTPUT_DIR)
rebuild: clean all
#Inclusion of dependencies (object files to source and includes)
-include $(OBJS:%.o=%.d)
But line 60-63 does not seem to be working:
$(OUTPUT_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $<
This line correspond to the following:
qcc -lang-c++ -Vgcc_ntox86_64 -c -Wp,-MMD,build/x86_64-debug/src/main.d,-MT,build/x86_64-debug/src/main.o -o build/x86_64-debug/src/main.o -build/x86_64-debug/src/Coordinate.h -build/x86_64-debug/src/Hitbox.h -build/x86_64-debug/src/Octree.h -Wall -fmessage-length=0 -g -O0 -fno-builtin src/main.cpp
And the error message is:
cc: unknown option: -build/x86_64-debug/src/Coordinate.h
Makefile:61: recipe for target 'build/x86_64-debug/src/Octree.o' failed
make: *** [build/x86_64-debug/src/Octree.o] Error 1
make: *** Waiting for unfinished jobs....
cc: unknown option: -build/x86_64-debug/src/Coordinate.h
Makefile:61: recipe for target 'build/x86_64-debug/src/main.o' failed
make: *** [build/x86_64-debug/src/main.o] Error 1
Any idea what I'm doing wrong?
The code compiles fine by using the usual linux gcc command syntax linking dependencies
c++ makefile dependencies
add a comment |
I have a C++ package I wish to compile. It contains the following
Coordinate.h
Coordinate.cpp
Hitbox.h
Hitbox.cpp
Octree.h
Octree.cpp
main.cpp
Main includes all header files. Octree has a dependency on Hitbox.h and Coordinate.h, and Hitbox inherits from Coordinate.h
My make file is as follow:
ARTIFACT = main
#Build architecture/variant string, possible values: x86, armv7le, etc...
PLATFORM ?= x86_64
#Build profile, possible values: release, debug, profile, coverage
BUILD_PROFILE ?= debug
CONFIG_NAME ?= $(PLATFORM)-$(BUILD_PROFILE)
OUTPUT_DIR = build/$(CONFIG_NAME)
TARGET = $(OUTPUT_DIR)/$(ARTIFACT)
#Compiler definitions
CC = qcc -Vgcc_nto$(PLATFORM)
CXX = qcc -lang-c++ -Vgcc_nto$(PLATFORM)
LD = $(CXX)
#User defined include/preprocessor flags and libraries
INCLUDES += -$(OUTPUT_DIR)/src/Coordinate.h
INCLUDES += -$(OUTPUT_DIR)/src/Hitbox.h
INCLUDES += -$(OUTPUT_DIR)/src/Octree.h
LIBS += -$(OUTPUT_DIR)/src/Coordinate.cpp
LIBS += -$(OUTPUT_DIR)/src/Hitbox.cpp
LIBS += -$(OUTPUT_DIR)/src/Octree.cpp
#LIBS += -L../mylib/$(OUTPUT_DIR) -lmylib
#Compiler flags for build profiles
CCFLAGS_release += -O2
CCFLAGS_debug += -g -O0 -fno-builtin
CCFLAGS_coverage += -g -O0 -ftest-coverage -fprofile-arcs -nopipe -Wc,-auxbase-strip,$@
LDFLAGS_coverage += -ftest-coverage -fprofile-arcs
CCFLAGS_profile += -g -O0 -finstrument-functions
LIBS_profile += -lprofilingS
#Generic compiler flags (which include build type flags)
CCFLAGS_all += -Wall -fmessage-length=0
CCFLAGS_all += $(CCFLAGS_$(BUILD_PROFILE))
#Shared library has to be compiled with -fPIC
#CCFLAGS_all += -fPIC
LDFLAGS_all += $(LDFLAGS_$(BUILD_PROFILE))
LIBS_all += $(LIBS_$(BUILD_PROFILE))
DEPS = -Wp,-MMD,$(@:%.o=%.d),-MT,$@
#Macro to expand files recursively: parameters $1 - directory, $2 - extension, i.e. cpp
rwildcard = $(wildcard $(addprefix $1/*.,$2)) $(foreach d,$(wildcard $1/*),$(call rwildcard,$d,$2))
#Source list
SRCS = $(call rwildcard, src, c cpp)
#Object files list
OBJS = $(addprefix $(OUTPUT_DIR)/,$(addsuffix .o, $(basename $(SRCS))))
#Compiling rule
$(OUTPUT_DIR)/%.o: %.c
@mkdir -p $(dir $@)
$(CC) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $<
$(OUTPUT_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $<
#Linking rule
$(TARGET):$(OBJS)
$(LD) -o $(TARGET) $(LDFLAGS_all) $(LDFLAGS) $(OBJS) $(LIBS_all) $(LIBS)
#Rules section for default compilation and linking
all: $(TARGET)
clean:
rm -fr $(OUTPUT_DIR)
rebuild: clean all
#Inclusion of dependencies (object files to source and includes)
-include $(OBJS:%.o=%.d)
But line 60-63 does not seem to be working:
$(OUTPUT_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $<
This line correspond to the following:
qcc -lang-c++ -Vgcc_ntox86_64 -c -Wp,-MMD,build/x86_64-debug/src/main.d,-MT,build/x86_64-debug/src/main.o -o build/x86_64-debug/src/main.o -build/x86_64-debug/src/Coordinate.h -build/x86_64-debug/src/Hitbox.h -build/x86_64-debug/src/Octree.h -Wall -fmessage-length=0 -g -O0 -fno-builtin src/main.cpp
And the error message is:
cc: unknown option: -build/x86_64-debug/src/Coordinate.h
Makefile:61: recipe for target 'build/x86_64-debug/src/Octree.o' failed
make: *** [build/x86_64-debug/src/Octree.o] Error 1
make: *** Waiting for unfinished jobs....
cc: unknown option: -build/x86_64-debug/src/Coordinate.h
Makefile:61: recipe for target 'build/x86_64-debug/src/main.o' failed
make: *** [build/x86_64-debug/src/main.o] Error 1
Any idea what I'm doing wrong?
The code compiles fine by using the usual linux gcc command syntax linking dependencies
c++ makefile dependencies
try replacing-$(OUTPUT_DIR)/src/*
with$(OUTPUT_DIR)/src/*
– Alexey Andronov
Nov 21 at 4:33
Thank you! Great catch! The error now says: qcc -lang-c++ -Vgcc_ntox86_64 -c -Wp,-MMD,build/x86_64-debug/src/main.d,-MT,build/x86_64-debug/src/main.o -o build/x86_64-debug/src/main.o build/x86_64-debug/src/Coordinate.h build/x86_64-debug/src/Hitbox.h build/x86_64-debug/src/Octree.h -Wall -fmessage-length=0 -g -O0 -fno-builtin src/main.cpp cc: Can't specify -P, -C, -E, -c or -S with -o and have multiple files make: *** [build/x86_64-debug/src/Octree.o] Error 1 Makefile:61: recipe for target 'build/x86_64-debug/src/Octree.o' failed make: *** Waiting for unfinished jobs....
– Matt
Nov 21 at 4:57
Well, I'm not proficient with gcc command line flags so I suggest you reduce your code to one filemain.cpp
and try to compile, then add the rest of the files one by one
– Alexey Andronov
Nov 21 at 5:14
You should probably have a look again at the gcc documentation. Include options are passed as-Ipath
, not-path
. Same for link options (-Lpath
not-path
).
– Renaud Pacalet
Nov 21 at 6:43
add a comment |
I have a C++ package I wish to compile. It contains the following
Coordinate.h
Coordinate.cpp
Hitbox.h
Hitbox.cpp
Octree.h
Octree.cpp
main.cpp
Main includes all header files. Octree has a dependency on Hitbox.h and Coordinate.h, and Hitbox inherits from Coordinate.h
My make file is as follow:
ARTIFACT = main
#Build architecture/variant string, possible values: x86, armv7le, etc...
PLATFORM ?= x86_64
#Build profile, possible values: release, debug, profile, coverage
BUILD_PROFILE ?= debug
CONFIG_NAME ?= $(PLATFORM)-$(BUILD_PROFILE)
OUTPUT_DIR = build/$(CONFIG_NAME)
TARGET = $(OUTPUT_DIR)/$(ARTIFACT)
#Compiler definitions
CC = qcc -Vgcc_nto$(PLATFORM)
CXX = qcc -lang-c++ -Vgcc_nto$(PLATFORM)
LD = $(CXX)
#User defined include/preprocessor flags and libraries
INCLUDES += -$(OUTPUT_DIR)/src/Coordinate.h
INCLUDES += -$(OUTPUT_DIR)/src/Hitbox.h
INCLUDES += -$(OUTPUT_DIR)/src/Octree.h
LIBS += -$(OUTPUT_DIR)/src/Coordinate.cpp
LIBS += -$(OUTPUT_DIR)/src/Hitbox.cpp
LIBS += -$(OUTPUT_DIR)/src/Octree.cpp
#LIBS += -L../mylib/$(OUTPUT_DIR) -lmylib
#Compiler flags for build profiles
CCFLAGS_release += -O2
CCFLAGS_debug += -g -O0 -fno-builtin
CCFLAGS_coverage += -g -O0 -ftest-coverage -fprofile-arcs -nopipe -Wc,-auxbase-strip,$@
LDFLAGS_coverage += -ftest-coverage -fprofile-arcs
CCFLAGS_profile += -g -O0 -finstrument-functions
LIBS_profile += -lprofilingS
#Generic compiler flags (which include build type flags)
CCFLAGS_all += -Wall -fmessage-length=0
CCFLAGS_all += $(CCFLAGS_$(BUILD_PROFILE))
#Shared library has to be compiled with -fPIC
#CCFLAGS_all += -fPIC
LDFLAGS_all += $(LDFLAGS_$(BUILD_PROFILE))
LIBS_all += $(LIBS_$(BUILD_PROFILE))
DEPS = -Wp,-MMD,$(@:%.o=%.d),-MT,$@
#Macro to expand files recursively: parameters $1 - directory, $2 - extension, i.e. cpp
rwildcard = $(wildcard $(addprefix $1/*.,$2)) $(foreach d,$(wildcard $1/*),$(call rwildcard,$d,$2))
#Source list
SRCS = $(call rwildcard, src, c cpp)
#Object files list
OBJS = $(addprefix $(OUTPUT_DIR)/,$(addsuffix .o, $(basename $(SRCS))))
#Compiling rule
$(OUTPUT_DIR)/%.o: %.c
@mkdir -p $(dir $@)
$(CC) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $<
$(OUTPUT_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $<
#Linking rule
$(TARGET):$(OBJS)
$(LD) -o $(TARGET) $(LDFLAGS_all) $(LDFLAGS) $(OBJS) $(LIBS_all) $(LIBS)
#Rules section for default compilation and linking
all: $(TARGET)
clean:
rm -fr $(OUTPUT_DIR)
rebuild: clean all
#Inclusion of dependencies (object files to source and includes)
-include $(OBJS:%.o=%.d)
But line 60-63 does not seem to be working:
$(OUTPUT_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $<
This line correspond to the following:
qcc -lang-c++ -Vgcc_ntox86_64 -c -Wp,-MMD,build/x86_64-debug/src/main.d,-MT,build/x86_64-debug/src/main.o -o build/x86_64-debug/src/main.o -build/x86_64-debug/src/Coordinate.h -build/x86_64-debug/src/Hitbox.h -build/x86_64-debug/src/Octree.h -Wall -fmessage-length=0 -g -O0 -fno-builtin src/main.cpp
And the error message is:
cc: unknown option: -build/x86_64-debug/src/Coordinate.h
Makefile:61: recipe for target 'build/x86_64-debug/src/Octree.o' failed
make: *** [build/x86_64-debug/src/Octree.o] Error 1
make: *** Waiting for unfinished jobs....
cc: unknown option: -build/x86_64-debug/src/Coordinate.h
Makefile:61: recipe for target 'build/x86_64-debug/src/main.o' failed
make: *** [build/x86_64-debug/src/main.o] Error 1
Any idea what I'm doing wrong?
The code compiles fine by using the usual linux gcc command syntax linking dependencies
c++ makefile dependencies
I have a C++ package I wish to compile. It contains the following
Coordinate.h
Coordinate.cpp
Hitbox.h
Hitbox.cpp
Octree.h
Octree.cpp
main.cpp
Main includes all header files. Octree has a dependency on Hitbox.h and Coordinate.h, and Hitbox inherits from Coordinate.h
My make file is as follow:
ARTIFACT = main
#Build architecture/variant string, possible values: x86, armv7le, etc...
PLATFORM ?= x86_64
#Build profile, possible values: release, debug, profile, coverage
BUILD_PROFILE ?= debug
CONFIG_NAME ?= $(PLATFORM)-$(BUILD_PROFILE)
OUTPUT_DIR = build/$(CONFIG_NAME)
TARGET = $(OUTPUT_DIR)/$(ARTIFACT)
#Compiler definitions
CC = qcc -Vgcc_nto$(PLATFORM)
CXX = qcc -lang-c++ -Vgcc_nto$(PLATFORM)
LD = $(CXX)
#User defined include/preprocessor flags and libraries
INCLUDES += -$(OUTPUT_DIR)/src/Coordinate.h
INCLUDES += -$(OUTPUT_DIR)/src/Hitbox.h
INCLUDES += -$(OUTPUT_DIR)/src/Octree.h
LIBS += -$(OUTPUT_DIR)/src/Coordinate.cpp
LIBS += -$(OUTPUT_DIR)/src/Hitbox.cpp
LIBS += -$(OUTPUT_DIR)/src/Octree.cpp
#LIBS += -L../mylib/$(OUTPUT_DIR) -lmylib
#Compiler flags for build profiles
CCFLAGS_release += -O2
CCFLAGS_debug += -g -O0 -fno-builtin
CCFLAGS_coverage += -g -O0 -ftest-coverage -fprofile-arcs -nopipe -Wc,-auxbase-strip,$@
LDFLAGS_coverage += -ftest-coverage -fprofile-arcs
CCFLAGS_profile += -g -O0 -finstrument-functions
LIBS_profile += -lprofilingS
#Generic compiler flags (which include build type flags)
CCFLAGS_all += -Wall -fmessage-length=0
CCFLAGS_all += $(CCFLAGS_$(BUILD_PROFILE))
#Shared library has to be compiled with -fPIC
#CCFLAGS_all += -fPIC
LDFLAGS_all += $(LDFLAGS_$(BUILD_PROFILE))
LIBS_all += $(LIBS_$(BUILD_PROFILE))
DEPS = -Wp,-MMD,$(@:%.o=%.d),-MT,$@
#Macro to expand files recursively: parameters $1 - directory, $2 - extension, i.e. cpp
rwildcard = $(wildcard $(addprefix $1/*.,$2)) $(foreach d,$(wildcard $1/*),$(call rwildcard,$d,$2))
#Source list
SRCS = $(call rwildcard, src, c cpp)
#Object files list
OBJS = $(addprefix $(OUTPUT_DIR)/,$(addsuffix .o, $(basename $(SRCS))))
#Compiling rule
$(OUTPUT_DIR)/%.o: %.c
@mkdir -p $(dir $@)
$(CC) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $<
$(OUTPUT_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $<
#Linking rule
$(TARGET):$(OBJS)
$(LD) -o $(TARGET) $(LDFLAGS_all) $(LDFLAGS) $(OBJS) $(LIBS_all) $(LIBS)
#Rules section for default compilation and linking
all: $(TARGET)
clean:
rm -fr $(OUTPUT_DIR)
rebuild: clean all
#Inclusion of dependencies (object files to source and includes)
-include $(OBJS:%.o=%.d)
But line 60-63 does not seem to be working:
$(OUTPUT_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $<
This line correspond to the following:
qcc -lang-c++ -Vgcc_ntox86_64 -c -Wp,-MMD,build/x86_64-debug/src/main.d,-MT,build/x86_64-debug/src/main.o -o build/x86_64-debug/src/main.o -build/x86_64-debug/src/Coordinate.h -build/x86_64-debug/src/Hitbox.h -build/x86_64-debug/src/Octree.h -Wall -fmessage-length=0 -g -O0 -fno-builtin src/main.cpp
And the error message is:
cc: unknown option: -build/x86_64-debug/src/Coordinate.h
Makefile:61: recipe for target 'build/x86_64-debug/src/Octree.o' failed
make: *** [build/x86_64-debug/src/Octree.o] Error 1
make: *** Waiting for unfinished jobs....
cc: unknown option: -build/x86_64-debug/src/Coordinate.h
Makefile:61: recipe for target 'build/x86_64-debug/src/main.o' failed
make: *** [build/x86_64-debug/src/main.o] Error 1
Any idea what I'm doing wrong?
The code compiles fine by using the usual linux gcc command syntax linking dependencies
c++ makefile dependencies
c++ makefile dependencies
asked Nov 21 at 4:21
Matt
113
113
try replacing-$(OUTPUT_DIR)/src/*
with$(OUTPUT_DIR)/src/*
– Alexey Andronov
Nov 21 at 4:33
Thank you! Great catch! The error now says: qcc -lang-c++ -Vgcc_ntox86_64 -c -Wp,-MMD,build/x86_64-debug/src/main.d,-MT,build/x86_64-debug/src/main.o -o build/x86_64-debug/src/main.o build/x86_64-debug/src/Coordinate.h build/x86_64-debug/src/Hitbox.h build/x86_64-debug/src/Octree.h -Wall -fmessage-length=0 -g -O0 -fno-builtin src/main.cpp cc: Can't specify -P, -C, -E, -c or -S with -o and have multiple files make: *** [build/x86_64-debug/src/Octree.o] Error 1 Makefile:61: recipe for target 'build/x86_64-debug/src/Octree.o' failed make: *** Waiting for unfinished jobs....
– Matt
Nov 21 at 4:57
Well, I'm not proficient with gcc command line flags so I suggest you reduce your code to one filemain.cpp
and try to compile, then add the rest of the files one by one
– Alexey Andronov
Nov 21 at 5:14
You should probably have a look again at the gcc documentation. Include options are passed as-Ipath
, not-path
. Same for link options (-Lpath
not-path
).
– Renaud Pacalet
Nov 21 at 6:43
add a comment |
try replacing-$(OUTPUT_DIR)/src/*
with$(OUTPUT_DIR)/src/*
– Alexey Andronov
Nov 21 at 4:33
Thank you! Great catch! The error now says: qcc -lang-c++ -Vgcc_ntox86_64 -c -Wp,-MMD,build/x86_64-debug/src/main.d,-MT,build/x86_64-debug/src/main.o -o build/x86_64-debug/src/main.o build/x86_64-debug/src/Coordinate.h build/x86_64-debug/src/Hitbox.h build/x86_64-debug/src/Octree.h -Wall -fmessage-length=0 -g -O0 -fno-builtin src/main.cpp cc: Can't specify -P, -C, -E, -c or -S with -o and have multiple files make: *** [build/x86_64-debug/src/Octree.o] Error 1 Makefile:61: recipe for target 'build/x86_64-debug/src/Octree.o' failed make: *** Waiting for unfinished jobs....
– Matt
Nov 21 at 4:57
Well, I'm not proficient with gcc command line flags so I suggest you reduce your code to one filemain.cpp
and try to compile, then add the rest of the files one by one
– Alexey Andronov
Nov 21 at 5:14
You should probably have a look again at the gcc documentation. Include options are passed as-Ipath
, not-path
. Same for link options (-Lpath
not-path
).
– Renaud Pacalet
Nov 21 at 6:43
try replacing
-$(OUTPUT_DIR)/src/*
with $(OUTPUT_DIR)/src/*
– Alexey Andronov
Nov 21 at 4:33
try replacing
-$(OUTPUT_DIR)/src/*
with $(OUTPUT_DIR)/src/*
– Alexey Andronov
Nov 21 at 4:33
Thank you! Great catch! The error now says: qcc -lang-c++ -Vgcc_ntox86_64 -c -Wp,-MMD,build/x86_64-debug/src/main.d,-MT,build/x86_64-debug/src/main.o -o build/x86_64-debug/src/main.o build/x86_64-debug/src/Coordinate.h build/x86_64-debug/src/Hitbox.h build/x86_64-debug/src/Octree.h -Wall -fmessage-length=0 -g -O0 -fno-builtin src/main.cpp cc: Can't specify -P, -C, -E, -c or -S with -o and have multiple files make: *** [build/x86_64-debug/src/Octree.o] Error 1 Makefile:61: recipe for target 'build/x86_64-debug/src/Octree.o' failed make: *** Waiting for unfinished jobs....
– Matt
Nov 21 at 4:57
Thank you! Great catch! The error now says: qcc -lang-c++ -Vgcc_ntox86_64 -c -Wp,-MMD,build/x86_64-debug/src/main.d,-MT,build/x86_64-debug/src/main.o -o build/x86_64-debug/src/main.o build/x86_64-debug/src/Coordinate.h build/x86_64-debug/src/Hitbox.h build/x86_64-debug/src/Octree.h -Wall -fmessage-length=0 -g -O0 -fno-builtin src/main.cpp cc: Can't specify -P, -C, -E, -c or -S with -o and have multiple files make: *** [build/x86_64-debug/src/Octree.o] Error 1 Makefile:61: recipe for target 'build/x86_64-debug/src/Octree.o' failed make: *** Waiting for unfinished jobs....
– Matt
Nov 21 at 4:57
Well, I'm not proficient with gcc command line flags so I suggest you reduce your code to one file
main.cpp
and try to compile, then add the rest of the files one by one– Alexey Andronov
Nov 21 at 5:14
Well, I'm not proficient with gcc command line flags so I suggest you reduce your code to one file
main.cpp
and try to compile, then add the rest of the files one by one– Alexey Andronov
Nov 21 at 5:14
You should probably have a look again at the gcc documentation. Include options are passed as
-Ipath
, not -path
. Same for link options (-Lpath
not -path
).– Renaud Pacalet
Nov 21 at 6:43
You should probably have a look again at the gcc documentation. Include options are passed as
-Ipath
, not -path
. Same for link options (-Lpath
not -path
).– Renaud Pacalet
Nov 21 at 6:43
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53405206%2fmakefile-recipe-for-target-foo-o-failed%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53405206%2fmakefile-recipe-for-target-foo-o-failed%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
try replacing
-$(OUTPUT_DIR)/src/*
with$(OUTPUT_DIR)/src/*
– Alexey Andronov
Nov 21 at 4:33
Thank you! Great catch! The error now says: qcc -lang-c++ -Vgcc_ntox86_64 -c -Wp,-MMD,build/x86_64-debug/src/main.d,-MT,build/x86_64-debug/src/main.o -o build/x86_64-debug/src/main.o build/x86_64-debug/src/Coordinate.h build/x86_64-debug/src/Hitbox.h build/x86_64-debug/src/Octree.h -Wall -fmessage-length=0 -g -O0 -fno-builtin src/main.cpp cc: Can't specify -P, -C, -E, -c or -S with -o and have multiple files make: *** [build/x86_64-debug/src/Octree.o] Error 1 Makefile:61: recipe for target 'build/x86_64-debug/src/Octree.o' failed make: *** Waiting for unfinished jobs....
– Matt
Nov 21 at 4:57
Well, I'm not proficient with gcc command line flags so I suggest you reduce your code to one file
main.cpp
and try to compile, then add the rest of the files one by one– Alexey Andronov
Nov 21 at 5:14
You should probably have a look again at the gcc documentation. Include options are passed as
-Ipath
, not-path
. Same for link options (-Lpath
not-path
).– Renaud Pacalet
Nov 21 at 6:43