Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Sketch building error (Read 19678 times)
Alexander12
Newbies
*
Offline


Posts: 9
Joined: Jun 5th, 2013
Sketch building error
Jun 15th, 2013 at 1:42pm
Print Post  
I created a new project and got the following error:
Quote:
Compiling 'p004_gateway_v1.0' for 'Arduino Uno'
Build folder: file://C:\Documents and Settings\axillent\Local Settings\Application Data\VMicro\Arduino\Builds\p004_gateway_v1.0\uno
core.a(main.cpp.o)* : : In function `main':
main.cpp : undefined reference to `setup'
main.cpp : undefined reference to `loop'
Error creating .elf


I've installed visulamicro just two weeks ago and my first sketch created was compiled successfully, but a new one created today failed. That is a reason?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Sketch building error
Reply #1 - Jun 15th, 2013 at 4:27pm
Print Post  
Hi,

This usually means that the main setup() and loop() functions are missing from your code. These two functions are required by Arduino.

I also notice that your sketch name is invalid, Arduino likes very simple sketch names. I think the . will cause a problem.

You should rename the folder and the p004_gateway_v1.0.ino to p004_gateway_v1

You have not stated if you are using visual studio or atmel studio. In either case if you manually rename then you should delete the .sln,.asln,vcproj,.proj files that exist in the folder of the respective IDE. Visual Micro will re-create the IDE files when you open the newly named sketch.

Thanks
  
Back to top
IP Logged
 
graynomad
Junior Member
**
Offline


Posts: 14
Location: nr Bundaberg, Australia
Joined: Oct 16th, 2011
Re: Sketch building error
Reply #2 - Jul 6th, 2013 at 3:01am
Print Post  
Did you resolve this?

I've also been using VM (VS2008 version) for a while and after cleaning up some folders I get this on both my projects.

EDIT: Sorry VM, I didn't notice your response. I started with totally clean folders, just my source files, but I'll have another look.

_____
Rob
« Last Edit: Jul 6th, 2013 at 3:03am by graynomad »  
Back to top
 
IP Logged
 
graynomad
Junior Member
**
Offline


Posts: 14
Location: nr Bundaberg, Australia
Joined: Oct 16th, 2011
Re: Sketch building error
Reply #3 - Jul 6th, 2013 at 3:58am
Print Post  
Update:

I cannot get a compile any more, I have a totally clean folder called genieArduino_v1 with a .CPP, .H and .INO files of the same name

Code
Select All
Compiling 'genieArduino_v1' for 'Arduino Mega 2560 or Mega ADK'
core.a(main.cpp.o)* : : In function `main':
main.cpp : undefined reference to `setup'
main.cpp : undefined reference to `loop'
avr-objcopy* : : Arduino_v1.elf': No such file
avr-objcopy* : : Arduino_v1.elf': No such file
Couldn't determine program size:
 



I also deleted every folder in

C:\Users\Rob\AppData\Local\VMicro\Arduino\Builds\

I'm officially stumped now.

_____
Rob
  
Back to top
 
IP Logged
 
graynomad
Junior Member
**
Offline


Posts: 14
Location: nr Bundaberg, Australia
Joined: Oct 16th, 2011
Re: Sketch building error
Reply #4 - Jul 6th, 2013 at 4:51am
Print Post  
OK, stop looking, I think I sussed it.

I was developing a library and had what will be the library source file in the same folder with the test sketch but with the name "genieArduinoLib.cpp". 

I renamed the "lib" file from genieArduinoLib.cpp to genieArduino.cpp thinking it would be nice to have all the files the same name, at the same time I cleaned up and renamed a few folders and so assumed that was at the root of my problem.

But I think what happens is that the Arduino toolchain renames x.ino to x.cpp at some point during the "compile", now you have two files with the same name and who knows what havoc that causes. Presumably what I saw above.

I changed it back to genieArduinoLib.cpp and it works.

So I've posted this for future reference.

_____
Rob
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Sketch building error
Reply #5 - Jul 6th, 2013 at 3:29pm
Print Post  
Yes the Arduino build process involves merging all ino/pde files into a single .cpp with the same name as the sketch, so it would cause a problem to include a source of the same name in your project.

The build process occurs in a temp folder so your sources were protected even though the build failed.

Thanks for the update.
  
Back to top
IP Logged
 
Cosmo
Newbies
*
Offline


Posts: 3
Location: Silicon Valley, USA
Joined: Apr 2nd, 2014
Re: Sketch building error
Reply #6 - Apr 3rd, 2014 at 6:30pm
Print Post  
Removing the "." from the file name worked for me. I had a filename "Motionv2.0". I left the project name as Motionv2.0, but just did a Save As... to Motionv2p0, and it compiled and uploaded properly (as first reply in the thread suggested).

happy arduinoing!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Sketch building error
Reply #7 - Apr 3rd, 2014 at 6:36pm
Print Post  
Hi,

Yes thanks for the post. You are right, the underlying Arduino tool chain only supports simple file names, less than 30 chars, can not start with a number or contain punctuation.

  
Back to top
IP Logged
 
Fatihs
Newbies
*
Offline


Posts: 4
Joined: Mar 2nd, 2014
Re: Sketch building error
Reply #8 - Apr 16th, 2014 at 5:21am
Print Post  
Same Error for me


compiler.path=P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\tools\avr\bin\
includes= -I"P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\arduino\avr\cores\arduino"  -I"P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\arduino\avr\variants\mega"  -I"P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\arduino\avr\libraries\Wire"  -I"P:\PicWorld\ProgramS\arduino-1_5_6-r2\libraries"  -I"P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\arduino\avr\libraries"  -I"P:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\default\debuggers"  -I"P:\Users\WorkPalace\Documents\Arduino\libraries"  lity"
a2560
build.project_name=a1
riants\mega
archive_file=core.a
ga2560\WString.cpp.o
uino\WString.cpp
mega2560\a1.cpp.o" \Wire.cpp.o" \utility\twi.c.o" 
build.architecture=avr
r\bin\
vmresolved.tools.path=P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\tools\avr

Compiling 'a1' for 'Arduino Mega w/ ATmega2560 (Mega 2560)'
Build folder: 60
Summary: Header=1 Prototypes=3 Imports=1
Additional Defines: VISUALMICRO_COMPILER_VER=1;
Architecture Tools: P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\tools\avr\bin\
GCC: 4.3.2
Sketchbook: file:///P:/Users/WorkPalace/Documents/Arduino
Include Path 'P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\arduino\avr\cores\arduino'
Include Path 'P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\arduino\avr\variants\mega'
Include Path 'P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\arduino\avr\libraries\Wire'
Include Path 'P:\PicWorld\ProgramS\arduino-1_5_6-r2\libraries'
Include Path 'P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\arduino\avr\libraries'
Include Path 'P:\Users\WorkPalace\Documents\Arduino\libraries'
"P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\tools\avr\bin\avr-g++" -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I"P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\arduino\avr\cores\arduino" -I"P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\arduino\avr\variants\mega" -I"P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\arduino\avr\libraries\Wire" -I"P:\PicWorld\ProgramS\arduino-1_5_6-r2\libraries" -I"P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\arduino\avr\libraries" -I"P:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\default\debuggers" -I"P:\Users\WorkPalace\Documents\Arduino\libraries" pp" -o pp.o" -DVISUALMICRO_COMPILER_VER=1
"P:\PicWorld\ProgramS\arduino-1_5_6-r2\hardware\tools\avr\bin\avr-gcc" -Os -Wl,--gc-sections -mmcu=atmega2560 -o lf" pp.o" \Wire.cpp.o" \utility\twi.c.o" .a" "-LC:\Users\WorkPalace\AppData\Local\VMicro\Arduino\Builds\a1\mega_atmega2560" -lm
a1.cpp.o:In function `__static_initialization_and_destruction_0'
a1.ino:LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char)'
a1.cpp.o:In function `loop'
a1.ino:setCursor(unsigned char, unsigned char)'
a1.ino:setCursor(unsigned char, unsigned char)'
a1.cpp.o:In function `setup'
a1.ino:init()'
a1.ino:backlight()'
a1.ino:cursor_on()'
a1.ino:blink_on()'
Error creating .elf
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Sketch building error
Reply #9 - Apr 16th, 2014 at 4:16pm
Print Post  
Hi Faiths,

If it is the same error that was resolved by this thread then please remove the invalid characters from the file name. It is an Arduino restriction that limits the file names to simple characters.

If it it not the same error then please create a new thread and also email the verbose output after "build>clean solution" to info[a]visualmicro.com

Thanks
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint