Make Error No Such File Or Directory
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and make: makefile no such file or directory policies of this site About Us Learn more about Stack Overflow the makefile no such file or directory include company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Makefile Fatal Error No Such File Or Directory
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes
Source: No Such File Or Directory
a minute: Sign up makefile “no such file or directory” up vote 0 down vote favorite I am trying to compile a C++ program using make. After reading quite a few tutorials, I have come upon the following make file. It reads source files from src directory, puts objects in the build directory, and puts the exe in the bin directory. When no rule to make target makefile I try running the following makefile, I get the subsequent error. CC := g++ CFLAGS := -g -O2 BIN_DIR := /bin BUILD_DIR := /build SRC_DIR := /src TARGET := wavfiletool.exe SOURCES := $(wildcard $(SRC_DIR)/*.c) OBJECTS := $(SOURCES:$(SRCDIR)/%.cpp=$(BUILD_DIR)/%.o) $(BIN_DIR)/$(TARGET): $(OBJECTS) $(CC) $@ $(CFLAGS) $(OBJECTS) $(OBJECTS): $(BUILD_DIR)/%.o : $(SRC_DIR)/%.c @$(CC) $(CFLAGS) -c $< -o $@ ++ /bin/wavfiletool.exe -g -O2 g++: error: /bin/wavfiletool.exe: No such file or directory g++: fatal error: no input files compilation terminated. make: *** [/bin/wavfiletool.exe] Error 1 [Finished in 0.1s with exit code 2] UPDATE: I have edited the makefile. One typo in the previous version was that I have .c when I am using .cpp and c++. I am now getting a different error. UPDATED MAKEFILE CC := g++ CFLAGS := -g -O2 BIN_DIR := bin BUILD_DIR := build SRC_DIR := src TARGET := wavfiletool.exe SOURCES := $(wildcard $(SRC_DIR)/*.cpp) OBJECTS := $(SOURCES:$(SRCDIR)/%.cpp=$(BUILD_DIR)/%.o) $(BIN_DIR)/$(TARGET): $(OBJECTS) $(CC) $(OBJECTS) $(CFLAGS) -o $@ $(OBJECTS): $(BUILD_DIR)/%.o : $(SRC_DIR)/%.cpp @$(CC) $(CFLAGS) -c $< -o $@ new error makefile:13: target `src/WavFile.cpp' doesn't match the target pattern makefile:13: target `src/WavFileTool.cpp' doesn't match the target pattern g++ src/WavFile.cpp src/WavFileToo
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more
Gcc No Such File Or Directory
about Stack Overflow the company Business Learn more about hiring developers or posting ads makefile example with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack c makefile Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Makefile is giving me an error - No such file or directory http://stackoverflow.com/questions/33092891/makefile-no-such-file-or-directory up vote 2 down vote favorite I have a very simple makefile. All I want to do in this makefile is compile my files and create an executable for my test. I have the following files: Test.cpp - main function BaseClass.cpp BaseClass.h - header file for the Base class DerivedClass.cpp - Inherits the base class DerivedClass.h - header file for the derived class Here is the makefile I have: http://stackoverflow.com/questions/20389809/makefile-is-giving-me-an-error-no-such-file-or-directory all: Test Test: BaseClass.o DerivedClass.o Test.o g++ -o BaseClass.o DerivedClass.o Test.o Test Test.o: Test.cpp BaseClass.h DerivedClass.h g++ -c Test.cpp Package.o: BaseClass.cpp BaseClass.h g++ -c BaseClass.cpp DerivedClass.o: DerivedClass.cpp DerivedClass.h g++ -c DerivedClass.cpp clean: rm -rf *.o I've never created a makefile for 5 files before. I can create one with 3 pretty easily, but I don't know what's wrong. The error I'm getting is: Test: No fuch file or directory EDIT: Thanks, Joe! That was it. Pretty silly oversight of mine. c++ makefile share|improve this question edited Dec 5 '13 at 2:04 asked Dec 5 '13 at 1:43 user2130057 158214 add a comment| 1 Answer 1 active oldest votes up vote 5 down vote accepted Test should be the argument to -o: Test: BaseClass.o DerivedClass.o Test.o g++ -o Test BaseClass.o DerivedClass.o Test.o Notice I moved Test from the end of the line to immediately after -o. share|improve this answer answered Dec 5 '13 at 1:45 Joe Z 12.2k11831 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you a
directory listing follow. Thank you. Makefile: 1
2
3
4
5
6
7
8
9
10
11
12
13
OBJS = obj/main.o http://www.cplusplus.com/forum/beginner/115568/ obj/file1.o obj/file2.o main.exe : $(OBJS) g++ -o main.exe $(OBJS) obj/main.o : main.cpp g++ -c $@ $< obj/file1.o : file1.cpp file1.h g++ -c $@ $< obj/file2.o https://github.com/dmlc/xgboost/issues/909 : ../lib/file2.cpp ../lib/file2.h g++ -c $@ $< g++ make error message: 1
2
3
4
D:\wolf\Documents\teensy\demo_make\src>make g++ -c obj/file1.o file1.cpp g++: error: obj/file1.o: No such file or directory no such make: *** [obj/file1.o] Error 1 directory structure (Makefile is in /src) 1
2
3
4
5
6
7
8
9
10
11
12
D:\wolf\Documents\teensy\demo_make>ls -R .: a.exe lib src ./lib: file2.cpp file2.cpp~ file2.h file2.h~ ./src: Makefile Makefile~ file1.cpp~ file1.h~ main.cpp~ obj Makefile - Copy file1.cpp file1.h main.cpp main.exe ./src/obj: Nov 3, 2013 at 5:18am UTC ne555 (8588) 1
2
//g++ -c obj/file1.o file1.cpp no such file g++ -c file1.cpp -o obj/file1.o Nov 3, 2013 at 6:52am UTC ShodanHo (110) You have your compile rule incorrect or the wrong way round for the compiler. Change each: g++ -c $@ $< to: g++ -c $< -o $@ The way you have it, you're asking the compiler to compile the object file and the source file. The meaning of the automatic variables $@, $< etc are explained here: http://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html Last edited on Nov 3, 2013 at 6:53am UTC Nov 3, 2013 at 12:05pm UTC wolfv (176) Thank you ne555 and ShodanHo. That worked, and I learned about the -o option: 3.2 Options Controlling the Kind of Output -o file Place output in file file. http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Overall-Options.html#Overall-Options Topic archived. No new replies allowed. C++ Information Tutorials Reference Articles Forum Forum BeginnersWindows ProgrammingUNIX/Linux ProgrammingGeneral C++ ProgrammingLoungeJobs Home page | Privacy policy© cplusplus.com, 2000-2016 - All rights reserved - v3.1Spotted an error? contact us
Sign in Pricing Blog Support Search GitHub This repository Watch 514 Star 4,706 Fork 2,546 dmlc/xgboost Code Issues 340 Pull requests 14 Projects 0 Wiki Pulse Graphs New issue g++: error: dmlc-core/libdmlc.a: No such file or directory #909 Open F36 opened this Issue Mar 4, 2016 · 17 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 8 participants F36 commented Mar 4, 2016 I take the next tutorial to install xgboost,however,when i the command "make -j4" ,i come across something wrong,why? thanks. git clone --recursive https://github.com/dmlc/xgboost cd xgboost git submodule init git submodule update cp make/mingw64.mk config.mk make -j4 the erro log is: g++: error: dmlc-core/libdmlc.a: No such file or directory g++: error: rabit/lib/librabit_empty.a: No such file or directory Makefile:120: recipe for target 'lib/libxgboost.dll' failed mingw32-make: *** [lib/libxgboost.dll] Error 1 👍 3 🎉 1 Distributed (Deep) Machine Learning Community member thirdwing commented Mar 4, 2016 It seems you don't show all the errors to us. Can you just use make and show us the error message? funkindy commented Mar 5, 2016 Same here: _g++: error: dmlc-core/libdmlc.a: No such file or directory g++: error: rabit/lib/librabit_empty.a: No such file or directory Makefile:120: recipe for target 'lib/libxgboost.dll' failed mingw32-make: *** [lib/libxgboost.dll] Error 1 mingw32-make: *** Waiting for unfinished jobs.... _ Installing on Win10 x64. Doing with the latest MinGW version. UPDATE solved accidentally: 1)Go to C:\mingw\mingw64\bin (your Mingw bin path) 2)Make a copy mingw32-make.exe -> make.exe (you got to have both of them in the bin path) 3) This: git clone --recursive https://github.com/dmlc/xgboost cd xgboost git submodule init git submodule update cp make/mingw64.mk config.mk make -j4 I guess something is wrong with the alias, thats why we need make.exe exactly. Distributed (Deep) Machine Learning Community member tqchen commented Mar 7, 2016 This was because we called make inside the Makefile @thirdwing Maybe we should update the instruction, or