473,386 Members | 1,602 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

during compilation of a program its showing error that "recipe for target 'mainn.o' f

6
during compilation of a program its showing error that "line 28",, G:\aa\Makefile.win
" recipe for target 'main.o' failed"
please help me how to debug it..
Jul 25 '15 #1
11 17619
weaknessforcats
9,208 Expert Mod 8TB
Where did you get the makefile?
Jul 25 '15 #2
Abhik
6
its installed in that DEV C++ software
Jul 25 '15 #3
weaknessforcats
9,208 Expert Mod 8TB
The makefile is generated based on your project code. Without seeing your code for main(), I can't say for sure but you may not have compiled correctly.

Generating an object file ( a .o) can fail if your code has errors.

Are there any other errors before this one?
Jul 25 '15 #4
Abhik
6
this is the makefile that is generated...

# Project: Project2
# Makefile created by Dev-C++ 5.11

CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
OBJ = main.o
LINKOBJ = main.o
LIBS = -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -static-libgcc -pg
INCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include"
CXXINCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++"
BIN = Project2.exe
CXXFLAGS = $(CXXINCS) -ansi -fno-asm -traditional-cpp -pg
CFLAGS = $(INCS) -ansi -fno-asm -traditional-cpp -pg
RM = rm.exe -f

.PHONY: all all-before all-after clean clean-custom

all: all-before $(BIN) all-after

clean: clean-custom
${RM} $(OBJ) $(BIN)

$(BIN): $(OBJ)
$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)

main.o: main.c
$(CC) -c main.c -o main.o $(CFLAGS)
Jul 26 '15 #5
Abhik
6
this line showing error...
main.o: main.c
$(CC) -c main.c -o main.o $(CFLAGS)
Jul 26 '15 #6
weaknessforcats
9,208 Expert Mod 8TB
All this tells me is that the error is in main.c. Generated makefiles like this one don't fail because of errors in the makefile.

That is, errors in your code are causing this. This also means that you are getting more errors than the one you reported.

What does your main.c look like?
Jul 26 '15 #7
Abhik
6
this is my main function

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[])
{
return 0;
}
Jul 26 '15 #8
weaknessforcats
9,208 Expert Mod 8TB
There are no errors in the code you posted. Is this the exact code you were compiling?
Jul 26 '15 #9
Abhik
6
yeah...while compiling the same program its showing that error...
Jul 27 '15 #10
donbock
2,426 Expert 2GB
Maybe gcc.exe is not accessible with your current PATH.
try typing the offending command at the command prompt:
gcc.exe -c main.c -o main.o
This can't succeed because it doesn't include the CFLAGS, but the nature of the failure will tell you if gcc is running. That command line should succeed if you temporarily comment out the #includes in main.c.
Jul 27 '15 #11
donbock
2,426 Expert 2GB
Maybe gcc.exe is not accessible with your current PATH.
try typing the offending command at the command prompt:
gcc.exe -c main.c -o main.o
This can't succeed because it doesn't include the CFLAGS, but the nature of the failure will tell you if gcc is running. That command line should succeed if you temporarily comment out the #includes in main.c.

Another possibility is that the long list of include paths makes the expanded command line too long for your shell.
Jul 27 '15 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ray | last post by:
Hi, I am receiving this message in the output during compilation; it is not an error nor a warning. I have <myAssembly> as a library assembly included as part of my solution, and I have also...
4
by: invincible | last post by:
hi, Problem: i want to initialise local varibles variables during compilation Question 1. Is there any flags to be set during compilation 2. By some possible ways
1
by: babak | last post by:
Hi everyone I'm doing a project in Microsoft embedded Visual C++ 4.0 and I get the following error when I try to compile: LINK : fatal error LNK1195: target machine 'ARM' requires...
1
by: Chris | last post by:
I built small C# Web and Web Service applications in a training class last week. The applications worked in the class, but when I tried to run them again over the weekend, they both bombed....
1
by: Pardhasaradhy | last post by:
Hi, Please see the following error and revert back as early as possible. I am getting this once I request for the asp.net page. Server Error in '/tanishq' Application. Timed out waiting for...
0
by: Marco Viana | last post by:
Hi, I'm developing an ASP.NET application with Visual Studio .NET 2003 in a Win XP Professional, .NET Framework 1.1 and IIS 5.1 computer with all the lattest patches. When testing a page...
17
by: abdur_rab7 | last post by:
Hi, I am compiling code for nanosleep in CYGWIN. During compilation i get the following error Socket.cc: In method `bool Socket::hangOnConnection(int = 0)': Socket.cc:338: aggregate `struct...
5
by: Stuart Carnie | last post by:
I suspect it's unlikely, but you'll never know until you ask, but are there any attributes that would allow us to contribute to the compiled output? e.g. // this class exists in a separate,...
1
by: Tafungwa Takaindisa | last post by:
I am installing Oracle 9.2.0.1.0 on AIX 5.3 , the installation goes through but the linking fails @ 63% showing error msg: Error invoking target install of makefile...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.