Right now I am doing Object-Oriented-Programming (OOP) in C++, and
I am getting to the point where I want each pair of class files (one .h
file and one .cpp file) in there own directory. How do I edit my Makefile
so that it looks in these sub-directories? Can this be done with the -I
command? My Makefile works except when I put `ThisExample.cpp' and `ThisExample.o' in a subdirectory called 'This'. I get the following error
message:
prompt# make
make: *** No rule to make target `ThisExample.cpp', needed by `ThisExample.o'. Stop.
Thanks in advance for your time and help in solving this problem.
------------------------------------------------------------------------
This is my Makefile:
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Makefile for Unix & Linux Systems #
# using a GNU C++ compiler #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# compiler flags
# -g --Enable debugging
# -Wall --Turn on all warnings
# -D_USE_FIXED_PROTOTYPES_
# --Force the compiler to use the correct headers
# -ansi --Don't use GNU ext; do use ansi standard.
CXX = g++
CXXFLAGS = -ansi -Wall
INCLUDE = -I./This/This*
OBJECTS = main.o ThisExample.o
EXE = Example
MAIN = main
TARGET1 = ThisExample
#Link command:
$(EXE): $(OBJECTS)
$(CXX) $(CXXFlAGS) $(INCLUDE) $(OBJECTS) -o $(EXE)
#Compilation commands:
$(MAIN).o: $(MAIN).cpp
$(CXX) $(CXXFlAGS) $(INCLUDE) -c $(MAIN).cpp -o $(MAIN).o
$(TARGET1).o: $(TARGET1).cpp
$(CXX) $(CXXFlAGS) $(INCLUDE) -c $(TARGET1).cpp -o $(TARGET1).o
#make clean
clean:
rm -f *.o
I am getting to the point where I want each pair of class files (one .h
file and one .cpp file) in there own directory. How do I edit my Makefile
so that it looks in these sub-directories? Can this be done with the -I
command? My Makefile works except when I put `ThisExample.cpp' and `ThisExample.o' in a subdirectory called 'This'. I get the following error
message:
prompt# make
make: *** No rule to make target `ThisExample.cpp', needed by `ThisExample.o'. Stop.
Thanks in advance for your time and help in solving this problem.
------------------------------------------------------------------------
This is my Makefile:
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Makefile for Unix & Linux Systems #
# using a GNU C++ compiler #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# compiler flags
# -g --Enable debugging
# -Wall --Turn on all warnings
# -D_USE_FIXED_PROTOTYPES_
# --Force the compiler to use the correct headers
# -ansi --Don't use GNU ext; do use ansi standard.
CXX = g++
CXXFLAGS = -ansi -Wall
INCLUDE = -I./This/This*
OBJECTS = main.o ThisExample.o
EXE = Example
MAIN = main
TARGET1 = ThisExample
#Link command:
$(EXE): $(OBJECTS)
$(CXX) $(CXXFlAGS) $(INCLUDE) $(OBJECTS) -o $(EXE)
#Compilation commands:
$(MAIN).o: $(MAIN).cpp
$(CXX) $(CXXFlAGS) $(INCLUDE) -c $(MAIN).cpp -o $(MAIN).o
$(TARGET1).o: $(TARGET1).cpp
$(CXX) $(CXXFlAGS) $(INCLUDE) -c $(TARGET1).cpp -o $(TARGET1).o
#make clean
clean:
rm -f *.o
- How To Put Gnu Make In Path For Dev C Free
- How To Put Gnu Make In Path For Dev C 2017
- How To Put Gnu Make In Path For Dev C Online
How To Put Gnu Make In Path For Dev C Free
Prev Next In this chapter, we are going to learn how to setup C development environment using GCC compiler in your machine and how to compile and execute a C program by your own. Free download dev c++ filehippo. Note: GCC (GNU Compiler Collection) is a compiler used to compile both C and C programs. GCC is just a compiler. https://powerfulcase923.weebly.com/cooking-fear-game-download.html. Aug 18, 2008 How to get a GNU Make for dev-c and how to adjust Bin setting or system Path environment variable?
![C++ C++](/uploads/1/2/6/6/126605831/759337065.jpg)
How To Put Gnu Make In Path For Dev C 2017
![How To Put Gnu Make In Path For Dev C++ How To Put Gnu Make In Path For Dev C++](/uploads/1/2/6/6/126605831/893478871.png)
How To Put Gnu Make In Path For Dev C Online
- I down loaded Dev-C executable (for Window XP); then double clicked it to install it. I received following message: There doesn't seem to be GNU Make file in PATH or in Dev-C's Bin path.
- Sep 19, 2019 Install GCC, GFortran, and GNU Make on Windows via MinGW 19 September, 2019. The GNU compilers (gcc, g and gfortran) and GNU Make are available using MinGW for native Windows.
- Cpp -v /dev/null -o /dev/null There are a number of command-line options you can use to add additional directories to the search path. The most commonly-used option is -I dir, which causes dir to be searched after the current directory (for the quote form of the directive) and ahead of the standard system directories.