recipe for target main.o failed in atmel studio 7

Go To Last Post
19 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I'm instal the lastest version of Atmel Studio from the atmel.com
I'm trying to make a very simple program but i can't !!

 

#include <avr/io.h>


int main(void)
{
    /* Replace with your application code */
    while (1) 
    {
    }
}

The Problem(Error) is:  

recipe for target 'main.o' failed 

 

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

SHELL := cmd.exe
RM := rm -rf

USER_OBJS :=

LIBS := 
PROJ := 

O_SRCS := 
C_SRCS := 
S_SRCS := 
S_UPPER_SRCS := 
OBJ_SRCS := 
ASM_SRCS := 
PREPROCESSING_SRCS := 
OBJS := 
OBJS_AS_ARGS := 
C_DEPS := 
C_DEPS_AS_ARGS := 
EXECUTABLES := 
OUTPUT_FILE_PATH :=
OUTPUT_FILE_PATH_AS_ARGS :=
AVR_APP_PATH :=$$$AVR_APP_PATH$$$
QUOTE := "
ADDITIONAL_DEPENDENCIES:=
OUTPUT_FILE_DEP:=
LIB_DEP:=
LINKER_SCRIPT_DEP:=

# Every subdirectory with source files must be described here
SUBDIRS := 


# Add inputs and outputs from these tool invocations to the build variables 
C_SRCS +=  \
../main.c


PREPROCESSING_SRCS += 


ASM_SRCS += 


OBJS +=  \
main.o

OBJS_AS_ARGS +=  \
main.o

C_DEPS +=  \
main.d

C_DEPS_AS_ARGS +=  \
main.d

OUTPUT_FILE_PATH +=GccApplication2.elf

OUTPUT_FILE_PATH_AS_ARGS +=GccApplication2.elf

ADDITIONAL_DEPENDENCIES:=

OUTPUT_FILE_DEP:= ./makedep.mk

LIB_DEP+= 

LINKER_SCRIPT_DEP+= 


# AVR32/GNU C Compiler



./%.o: .././%.c
	@echo Building file: $<
	@echo Invoking: AVR/GNU C Compiler : 4.9.2
	$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE)  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega8a -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\gcc\dev\atmega8a" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)"   -o "$@" "$<" 
	@echo Finished building: $<
	



# AVR32/GNU Preprocessing Assembler

thanks for your help.

This topic has a solution.
Last Edited: Mon. Dec 19, 2016 - 11:09 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Robo-amir wrote:

 

#include <avr/io.h>

int main(void)
{
    /* Replace with your application code */
    while (1)
    {
    }
}

 

I would make things as simple as possible and remove the #include.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Robo-amir wrote:

 


# AVR32/GNU C Compiler

	$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) 

 

This seems strange to me, but I've never used a 32 bit AVR.

Last Edited: Sat. Dec 17, 2016 - 08:39 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Go to the outputs tab/window in studio and paste the full build output here.

[Fixed tense]

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

Last Edited: Sat. Dec 17, 2016 - 10:55 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meolsen wrote:
Go to the outputs tab/window in studio and past the full build output here.

 

Absolutely!

 

"recipe for target main.o failed" is simply a summary telling you that the build was unsuccessful - you need to look at the earlier output to determine why it failed.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

meolsen wrote:Go to the outputs tab/window in studio and past the full build output here.

 

Absolutely!

 

Well, not absolutely.  I would say paste. 

 

I debated if I should point this out.  Maybe with two people whose native language is not English having a conversation in English could get a bit confusing.

 

I've never thought about language much until lately.  Languages are complicated.

 

The original sentence without the here at the end does make sense, so it would take a smart spell checker to point out the error.  It's the "here" at the end that caused me to go back and re-read it.

 

Go to the outputs tab/window in studio and past the full build output

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hihi. Updated my post. Guess that's what I get when writing on my phone (side note, phone autocorrect etc does not like multilingual writing... Keep getting Norwegian into my English dictionary).

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
------ Build started: Project: GccApplication1, Configuration: Debug AVR ------
Build started.
Project "GccApplication1.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "D:\test\GccApplication1\GccApplication1\GccApplication1.cproj" (target "Build" depends on it):
	Task "RunCompilerTask"
		Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
		C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 4 --output-sync 
D:\test\GccApplication1\GccApplication1\Debug\Makefile(79,1): error: recipe for target 'main.o' failed
		'C:\Users\R' is not recognized as an internal or external command,
		operable program or batch file.
		The system cannot find the path specified.
		make: *** [main.o] Error 1
	Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "GccApplication1.cproj" -- FAILED.
Done building project "GccApplication1.cproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
'C:\Users\R' is not recognized as an internal or external command,

Do you have any funny characters in your user name? Move the project away from that folder, and all should be good...

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

Yes my user name is R&D

I think its the problem but my project is in D !!!

D:\test\GccApplication1\GccApplication1\Debug\Makefile(79,1): error: recipe for target 'main.o' failed

 

Last Edited: Sun. Dec 18, 2016 - 09:43 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Having moved it once again show the complete build output. The "recipe failed" is just the final (not very helpful!) consequence of some error. It's what happened earlier that is important.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The '&' character means something special to GNU utility programs as indicated by the failure to parse past the '&' here.

'C:\Users\R'

avr-gcc wants to create temporary files in this directory and will fail to do so :

'C:\Users\R&D\Appdata\Local\Temp'

 

You'll get going much quicker if you create a new Windows user with a more GNU friendly username rather than try to change the default windows temp directory.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah - this old chestnut again!

 

This comes up with monotonous regularity; it is what you get for putting "funny" characters in file and/or folder names. It has nothing specifically to do with Atmel nor AVR nor GNU.

 

Simple rule: Never use spaces nor any other "special" characters (including ampersand '&', punctuation, etc) in file or folder names.

 

Sure, there are ways to get around it - but the simplest way is to simply avoid the problem in the first place!

 

I have a detailed post about this somewhere, which I carefully bookmarked for easy reference - but the bookmarks are broken again

 

angry

and I son't hold out much hope for the site search.

 

angry

 

 

EDIT

 

To emphasise that it's nothing specifically to do with Atmel nor AVR nor GNU:

 

http://www.keil.com/forum/62427/...

 

 

EDIT 2

 

Note that '+' has a special meaning on the  Windows (and DOS) command line - so that's another one to avoid (as for '&').

 

 

EDIT 3

 

Personally, I've always been wary of having a dot as part of a file or folder name (other than, of course, between the name & extension) - but people mostly seem to get away with it.

 

Until now: https://www.avrfreaks.net/commen...

 

 

 

#SpaceInPath

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Jul 12, 2018 - 10:52 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
bookmarks are broken again

https://www.avrfreaks.net/forum/b...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have NEVER seen a site search better than google (obviously that is only if search engines are allowed to crawl it) so let's give them a go:

 

{google search term edited away}

 

Well what d'ya know ?

 

 

Unfortunately not a true googlewhack because awneil isn't a dictionary word. AND You've probably ruined after the next indexing by posting #13 - so let me edit my search term away. Here's the result link:

https://www.avrfreaks.net/forum/error-1-please-explane

 

Last Edited: Sun. Dec 18, 2016 - 05:39 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

N.Winterbottom wrote:
The '&' character means something special to GNU utility programs

It also means something special to Windows - so double trouble here!

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks a lot for replies.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

give full control access in program file(where its installed in c drive ) Then it will work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No, it won't.

 

The cause has already been identified: it was not a rights issues - see the post marked as the solution.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...