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 Bizarre Errors In Near Empty User Library.... (Read 5210 times)
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Bizarre Errors In Near Empty User Library....
Sep 21st, 2013 at 3:10pm
Print Post  
I realize this is better posted to the Arduino forum, but I have tried numerous times to create an account there, and never receive the confirmation e-mail, so can't make posts.  I'm hoping someone here can tell me WTF I'm doing wrong.....

I'm trying to create a new User library object, but I'm running into a really bizarre problem.  I have stripped the code down to the bare bones, and the errors are still there.  Here is all the code:

FlashCopy.h:

#ifndef FLASHCOPY_H
#define FLASHCOPY_H

class FlashCopy
{
     public:
           FlashCopy();
           int copy(void);

     private:
};

#endif


FlashCopy.cpp:

#include <FlashCopy.h>

FlashCopy::FlashCopy()
{
}


int FlashCopy::copy(void) {
     return 0;
}


FlashCopyTest.ino:

#include <FlashCopy.h>

FlashCopy flashcopy();

void setup()
{
}

void loop()
{
}


FlashCopy.h and FlashCopy.cpp are in Arduino/libraries/FlashCopy, along with FlashCopy.txt.  FlashCopyTest.ino is in Arduino/FlashCopyTest.  When I compile, I get:

Compiling 'FlashCopyTest' for 'Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328'
FlashCopy.cpp : stray '\357' in program
FlashCopy.cpp : stray '\273' in program
FlashCopy.cpp : stray '\277' in program
FlashCopy.cpp : stray '#' in program
FlashCopy.cpp : expected constructor, destructor, or type conversion before '<' token
FlashCopy.cpp : 'FlashCopy' has not been declared
Error compiling


I'm especially baffled by the "stray 'xxx' in program errors.  Those are not even printable characters, and there are no such characters in any of the files.  I have seen this before, always when trying to create new libraries.  In the past, I've just fiddled with things until they went away, without ever really knowing what was happening.  This time, I've been unable to make it work, even when stripped to the skeleton library above.

Regards,
Ray L.

  
Back to top
 
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: Bizarre Errors In Near Empty User Library....
Reply #1 - Sep 21st, 2013 at 5:37pm
Print Post  
I did finally manage to get an account established on the Arduino forum, and made the same post over there.  One of the guys cut and pasted my code and created the same library and application.  With a couple of minor edits, it compiled without error for him.  Making the same edits here changed nothing.  The fact that he was able to make it compile on his system strongly suggests the problem is not the code itself, but something in the configuration on my machine.  But what?  I get the same error compiling in the Arduino IDE....

Regards,
Ray L.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Bizarre Errors In Near Empty User Library....
Reply #2 - Sep 21st, 2013 at 7:08pm
Print Post  
Hi Ray,

I've seen this before a couple of times. The source code just needs to be saved once forcing ANSI format. This will covert international unicode characters (sometimes can't be seen) to ANSI. From then on VS then will continue to save the file correctly as ANSI.

Solution

Open the cpp with notepad and click "save as". Notice the "Encoding" combo box. Change it to ANSI and then click Save
  
Back to top
WWW  
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: Bizarre Errors In Near Empty User Library....
Reply #3 - Sep 21st, 2013 at 8:35pm
Print Post  
Tim,

THANK YOU!!!  That did it!   

Regards,
Ray L.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint