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) EEPROM: Error in compilation (Read 11586 times)
bionicle
Junior Member
**
Offline


Posts: 11
Location: D
Joined: Feb 1st, 2013
EEPROM: Error in compilation
Oct 6th, 2014 at 6:03pm
Print Post  
Hello all,
I use Atmel Studio 6.2 + Visual Micro (latest version) + Arduino Nano 328
I get an error message when I compile this very simple code:
In the Arduino IDE I get no error!

#include "EEPROM.h"
int addr,data;

void setup(){
addr=1;
data=125;}

void loop(){
EEPROM.write(addr,data);}


The error Message is:                  
Compiling 'eepr' for 'Arduino Nano w/ ATmega328'
EEPROM.cpp.o:In function `EEPROMClass::write(int, unsigned char)'
EEPROM.cpp:undefined reference to `__eewr_byte_m328p'
Error creating .elf


The EEPROM function is the problem, even if I take a different library (EEPROMEX) the problem remains!
Is this a bug? What can I do ? 
Thanks for any help
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: EEPROM: Error in compilation
Reply #1 - Oct 6th, 2014 at 6:29pm
Print Post  
Hi,

Your code compiles fine for me. Is Visual Micro pointing to the same Arduino version that you tested with?

If you switch on "tools>visual micro>verbose messages" then do a full compile you can then email the output to info [at] visualmicro.com along with a zip of the sketch folder and all its source codes.

I tested your code with arduino 1.0.x and 1.5.x from Atmel Studio 6.2

Thanks

  
Back to top
IP Logged
 
bionicle
Junior Member
**
Offline


Posts: 11
Location: D
Joined: Feb 1st, 2013
Re: EEPROM: Error in compilation
Reply #2 - Oct 6th, 2014 at 7:48pm
Print Post  
Hi,
Yes, Visual Micro is pointing to Arduino 1.05 and I tested the code with this version. I will send the verbose error message with all the Project files via e-mail.
Thanks
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: EEPROM: Error in compilation
Reply #3 - Oct 6th, 2014 at 8:32pm
Print Post  
Hi,

Please open the arduino ide and tell me if a path is in the SketchBook property? If so what is it.

Thanks
« Last Edit: Oct 7th, 2014 at 3:25pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: EEPROM: Error in compilation
Reply #4 - Oct 7th, 2014 at 3:29pm
Print Post  
For anyone else reading this post the reason for this problem is that the user has specified a different sketchbook folder in the arduino ide than in Visual Micro. 

It's best to leave the sketchbook folder empty until you understand what it does.

With arduino the sketch book folder also specifies the location of user libraries. 

Bionical has specified a sketch book folder of "z:\arduino" but also has an eeprom library in z:\arduino\libraries\eeprom.

So when he compiles with the arduino ide it finds the proper eeprom library and works but Visual Micro (correctly) finds a different eeprom library which in this case does not work for the selected hardware.

It is worth noting that an empty sketchbook folder in visual micro will detect the settings from the arduino ide. If you want to compare Visual Micro with Arduino you should ensure that both apps are configured the same way and the easiest way to do this is to leave the visual micro sketch book property empty. It will be less confusing this way.
« Last Edit: Oct 9th, 2014 at 6:25pm by Tim@Visual Micro »  
Back to top
IP Logged
 
bionicle
Junior Member
**
Offline


Posts: 11
Location: D
Joined: Feb 1st, 2013
Re: EEPROM: Error in compilation
Reply #5 - Oct 8th, 2014 at 9:00pm
Print Post  
Hello,
I am totally confused now: I have no X:\ -drive on my Computer or network!
I only have Z:\
The skechbook folder in the arduino IDE is C:\Users\Vatti\Documents\Arduino
I always thought, that Visual micro takes the same library folder like the Arduino IDE. 
Every time I get a new library I put it only into the standard Arduino library folder. In my case this is: C:\Program Files (x86)\arduino-1.0.5\libraries. Up to now this always worked except with EEPROM.

OK, I have removed in Visual Micro the "skechbock location" , restarted Atmel studio but the problem remains !

What can I do ??

Thanks for your help
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: EEPROM: Error in compilation
Reply #6 - Oct 8th, 2014 at 9:28pm
Print Post  
Hi,

Thanks for the info. let's work with an empty sketch book folder so we use the same config as Arduino.

It's possible the eeprom lib is cached try click Build>clean Solution then compile.

If that fails look in the verbose build output to see where the eeprom lib is being compiled from?

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


Posts: 11
Location: D
Joined: Feb 1st, 2013
Re: EEPROM: Error in compilation
Reply #7 - Oct 9th, 2014 at 6:17pm
Print Post  
Hi 
I followed your advice but I still get the same error message.
In the verbose output it is listed several times:
Include Path 'C:\Program Files (x86)\arduino_1.0.5\libraries\EEPROM'
This is where we expect visual micro to look for the libraries.
If I compile without the "EEPROM.write..... command, only with the include "#include EEPROM.h" then I get no error message !
No more ideas ? is it a good Idea to re-install everything again ?
The strange thing is: I get the same error on my PC and on my laptop !! both have the same softwares.

Please help, I am currently working on a self balancing vehicle arduino project.
I use Arduino since many years and Visual micro since aprox. 1 year

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: EEPROM: Error in compilation
Reply #8 - Oct 9th, 2014 at 6:25pm
Print Post  
Thanks for all the info.

I am afraid that re-installing will not help. Any reason for a compiler error "should" be easily resolved (but I know it isn't in this case)

Now that we have the same config as the Arduino Ide please email a verbose build after clicking tools>build>clean solution.

The open the same sketch int he arduino ide, switch on "file>preferences>verbose compile" then run the compile and email the output .

The comparison of the two build outputs should show the difference.

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


Posts: 11
Location: D
Joined: Feb 1st, 2013
Re: EEPROM: Error in compilation
Reply #9 - Oct 11th, 2014 at 7:07pm
Print Post  
Hi,
I made some experiments:
On my PC I still have an old Atmel studio: Version 6.1 including VM
I copied my code (including EEPROM function) into this version - compilation worked !!
This Version works fully local without using the NAS - I think this is the solution.
After that I copied my code into Atmel 6.2, saved it locally (a different project name), then compilation also worked. So I think there is a timing problem in my NAS Network.
OK, for the forum my broblem is solved I continue to check my NAS.

Thanks for the support !!!

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: EEPROM: Error in compilation
Reply #10 - Oct 11th, 2014 at 7:52pm
Print Post  
Oh, thanks for the update
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint