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
Normal Topic Error compiling - "Error creating .elf" (Read 7589 times)
roger co
Junior Member
**
Offline


Posts: 14
Joined: Jul 14th, 2014
Error compiling - "Error creating .elf"
Jul 14th, 2014 at 9:52am
Print Post  
I am getting the following when I try to compile. 
Compiling 'U1407RCO-BLP-MG-AngPunGSR' for 'Arduino Uno'
core.a(main.cpp.o)*:In function `main'
main.cpp:undefined reference to `setup'
main.cpp:undefined reference to `loop'
Error creating .elf


Visual Studio 2012 v11.0. update 4
Visual Micro 1.1407.10
Arduino Uno connected to Com10

Sketch has both void setup()  and void loop() and there is only one .ino file in the project ("U1407RCO-BLP-MG-AngPunGSR.ino"). There are some comments and static const and variable declarations before the setup function and three more functions after the main loop, syntax is correct, but it seems that the compiler is failing to recognise the functions 

Other previous projects load and compile ok.

Compile in either debug or release config gives the same result.

Any clues anyone?



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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error compiling - "Error creating .elf"
Reply #1 - Jul 14th, 2014 at 12:54pm
Print Post  
Hi,

Does the sketch compile when using the Arduino Ide?

Thanks
  
Back to top
IP Logged
 
roger co
Junior Member
**
Offline


Posts: 14
Joined: Jul 14th, 2014
Re: Error compiling - "Error creating .elf"
Reply #2 - Jul 14th, 2014 at 1:04pm
Print Post  
Ah-ha - I should have thought to try that. No it doesn't and gives the more helpfull error message:
Sketch names must contain only basic letters and numbers (ASCII-only with no spaces, and it cannot start with a number).
Bang goes our project naming convention, or rather we can still name projects the way we want but will have to not use the project name as the sketch file name.
Thanks for the help. Possibly VisMicro could improve the error message and/or check sketch names as they are created.
RogerCO
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error compiling - "Error creating .elf"
Reply #3 - Jul 14th, 2014 at 1:06pm
Print Post  
Hi,

I suspected that was the case.

There is some checking in Visual Micro and also a warning in Atmel Studio on the new project wizard.

How did you create the sketch? Which commands did you use?

Thanks
  
Back to top
IP Logged
 
roger co
Junior Member
**
Offline


Posts: 14
Joined: Jul 14th, 2014
Re: Error compiling - "Error creating .elf"
Reply #4 - Jul 14th, 2014 at 1:14pm
Print Post  
In Visual Studio
File - New - Sketch Project
Enter a project name including a hyphen and an underscore
"Test-Project_title"
The sketch file will be created as "Test-Project_title.ino", the project name will be "Test-Project_title" but the Root Namespace under Project Properties will be "TestProject_title"
So it looks like VisMicro is accepting the project name and changing the Root Namespace to match the Arduino compiler requirements but not changing the name of the sketch file it creates.
Sounds like a fairly minor bug fix to automatically strip out unwanted chars in the name before creating the sketch file when creating the project.
RogerCO
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error compiling - "Error creating .elf"
Reply #5 - Jul 14th, 2014 at 1:24pm
Print Post  
Thanks, there used to be some code to handle that. maybe it is missing or maybe ignoring dashes. Thanks for the report and the clarity Smiley
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error compiling - "Error creating .elf"
Reply #6 - Jan 10th, 2015 at 10:54pm
Print Post  
note: Fixed in releases towards the end of 2014, see release notes
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint