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) Visual Micro includes random *.cpp files from RobotControl resulting in errors. (Read 14717 times)
EraYaN
Newbies
*
Offline


Posts: 9
Location: Netherlands
Joined: Feb 1st, 2013
Visual Micro includes random *.cpp files from RobotControl resulting in errors.
May 20th, 2013 at 4:25pm
Print Post  
Visual Micro includes some weird *.cpp files from RobotControl when building this code:

Code
Select All
http://pastebin.com/2DbJcFZ8
 


* the post length limit prevents me from posting the code here

Micro Build output:

Code
Select All
Compiling 'WebSiteServer' for 'Arduino Mega 2560 or Mega ADK'
Build folder:
ArduinoRobot.cpp : : In constructor 'RobotControl::RobotControl()':
ArduinoRobot.cpp : 'LCD_CS' was not declared in this scope
ArduinoRobot.cpp : 'DC_LCD' was not declared in this scope
ArduinoRobot.cpp : 'RST_LCD' was not declared in this scope
ArduinoRobot.cpp : : In member function 'void RobotControl::begin()':
ArduinoRobot.cpp : 'MUXA' was not declared in this scope
ArduinoRobot.cpp : 'MUXB' was not declared in this scope
ArduinoRobot.cpp : 'MUXC' was not declared in this scope
ArduinoRobot.cpp : 'MUXD' was not declared in this scope
ArduinoRobot.cpp : 'MUX_IN' was not declared in this scope
ArduinoRobot.cpp : 'BUZZ' was not declared in this scope
Error compiling
 



Output folder:


Erwin aka. /me 

PS. Maybe the forum editor deserves an upgrade... (YaBB 2.5? or custom? at least bigger (and not this 'fake' scaling thing))
« Last Edit: May 20th, 2013 at 4:25pm by EraYaN »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #1 - May 20th, 2013 at 5:32pm
Print Post  
Hello, please click "Build Clean", maybe a sketch with the same name previously included the robot library and vm has not cleaned the build folder correctly. 

Failing that please delete all the files in the bin folder which you should not need to do but will be a good test for me thanks.

I will do some testing for when a project of the same name previously existed for another purpose

You are right, you should only expect the libraries used in the current project to be copied to the build folder.

I assume you sketch compiles okay in the arduino ide?

Please tell me which arduino version you are using and which vs/atmel version you are using
  
Back to top
IP Logged
 
EraYaN
Newbies
*
Offline


Posts: 9
Location: Netherlands
Joined: Feb 1st, 2013
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #2 - May 20th, 2013 at 7:38pm
Print Post  
Cleaned -> build = same;
I already cleared the whole build folders..
It indeed compiles fine in de Arduino IDE (1.0.5)
VS version = 11.0.60315.01 Update 2

I have never included the robot library in anything... I don't have one..

I will try tomorrow on a computer that has never seen this sketch.

Erwin aka. * EraYaN
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #3 - May 20th, 2013 at 7:56pm
Print Post  
Okay thanks. 1.5 is beta for another week or so but I can tell you that vm does not know about any particular libraries.

What I think is happening is that a 1.5 format lib is confusing vm and that a 1.5 format lib contains a sub folder with the robot code.

It's going to be something like that, you can ignore my concerns about the build folder and can prove the problem by compiling for the 1280 board. The compile will give a new build folder and I suspect we will see the same lib appear.

This is why 1.0.4 is currently recommended and I am not sure that you will currently get any benefits with 1.5 for the 2560 so 1.0.4 will work well for you
  
Back to top
IP Logged
 
EraYaN
Newbies
*
Offline


Posts: 9
Location: Netherlands
Joined: Feb 1st, 2013
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #4 - May 20th, 2013 at 7:58pm
Print Post  
I don't use 1.5.. but 1.0.5 (small bugfix release)
Same errors for the 1280 or the uno or nano... (with an added error the Serial1 doesn't exists as is to be expected.)

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


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #5 - May 20th, 2013 at 8:08pm
Print Post  
Oh, sorry missed that, read 1.0.5 as 1.5.

Would you please zip and email the sketch to info [at] visualmicro.com

It sounds like a pretty straight forward setup so needs exploring.

Thanks
« Last Edit: May 20th, 2013 at 8:09pm by Tim@Visual Micro »  
Back to top
IP Logged
 
EraYaN
Newbies
*
Offline


Posts: 9
Location: Netherlands
Joined: Feb 1st, 2013
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #6 - May 20th, 2013 at 8:17pm
Print Post  
The pastebin http://pastebin.com/2DbJcFZ8 is all there is to it (In a project named WebSiteServer and then in a file WebSiteServer.ino)

I can also email it but well... All standard libraries.

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


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #7 - May 20th, 2013 at 8:38pm
Print Post  
No need I have just installed it and I think I can see the problem

They have changed the way libraries are resolved, it's a small change but means they can now have libraries containing source files with names that match sources contained within other libraries.

Personally I think this will cause some confusion for users, because, for example, the new robot libs contain files with names such as SPI.h. I think that in both vm and arduino ide this will break if a user has a project that already uses spi and subsequently want to experiment with an Arduino robot lib. But it's not my call, I will just do what Arduino does Smiley

Anyway I guess Arduino intend the robot libraries to have dedicated use of the Arduino and for robot projects to be created with using slightly different rules

To cut a long story short, I will of course change vm in the next few days to work the new way. In the meantime I suggest deleting the Robot_Control and Robot_Motor libraries from your arduino installation, for example D:\Arduino\arduino-1.0.5\libraries

The two robot libraries are for the new robot that Arduino announced over the last few days. It will be available in a month or so and is a complete hardware solution for a mini robot, this is why I think these two libraries, which are designed for this equipment, break all the rules. They seem to be more replacement firmwares than normal libraries

Hope this makes sense, sorry didn't notice I could grab the entire project from your example. very useful!
« Last Edit: May 20th, 2013 at 8:39pm by Tim@Visual Micro »  
Back to top
IP Logged
 
EraYaN
Newbies
*
Offline


Posts: 9
Location: Netherlands
Joined: Feb 1st, 2013
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #8 - May 20th, 2013 at 8:42pm
Print Post  
They should just have made it like any normal C compiler would do it. That you would have to include the path relative to the library folder say <Ethernet/Ethernet.h> that would solve all confusion...

EDIT: Maybe you can add a option flag to disable the addition of all the forced include folders (for every lib one)
« Last Edit: May 20th, 2013 at 8:43pm by EraYaN »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #9 - May 20th, 2013 at 8:54pm
Print Post  
I think they will change those two libs and that they just included them in 1.0.5 because they wanted to make the release of the new product at the maker faire.

You are not the first person to suggest a better compiler process!

Currently the libs have to be resolved from the project includes which do not contain paths.

Are you saying you would be happy to manage the c++ include paths and also ensure the correct includes for each lib in a project?

Currently when you include a project, all of the .h files from the project folder are included.

So you want to, optionally, drop all of this standard functionality for adding and resolving libs and set them manually yourself?

If so I would need some help testing the option and also determining how it might work with the 1.5 format which reads the entire build command from platform.txt and boards.txt located in the ide/hardware/arduino avr/sam folders.

I'm happy to add these options, it would be nice to create a small summary of all the manual build features we would like so that the work can be done in one lump
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #10 - May 20th, 2013 at 8:58pm
Print Post  
When you get a mo please confirm that removing those folders worked. 

If vs or atmel studio is open when they are removed then please click Project>Add Arduino Library>Refresh/Reload (can't remember what its called)

T
  
Back to top
IP Logged
 
EraYaN
Newbies
*
Offline


Posts: 9
Location: Netherlands
Joined: Feb 1st, 2013
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #11 - May 20th, 2013 at 9:07pm
Print Post  
I would certainly. For all my windows C++ projects I create a couple of folders:
include/ (any library *.h or (*.h and *.cpp))
lib/ (any shared *.lib or *.dll in they're own subfolder)

I add the include folder to the AdditionalIncludeDirs thing and lib to the correct var too.

So one would only include the *.h files that are explicitly #include'd in the *.cpp source's added to the solution (whenever one uses *.ino one could assume Arduino IDE behaviour otherwise not.)

avr-gcc and avr-ar can make *.a files together I guess one could build all libraries to one (put "lib" in front and ".a" after the library name). (and only rebuild if changed)

ex: avr-ld -Lmylibdir -lutils <other linker options here>
includes libutils.a from folder mylibdir
source: http://www.kovacs.cc/AVRBlog/index.html?http://www.kovacs.cc/AVRBlog/Main_Creati...
and: http://www.nongnu.org/avr-libc/user-manual/library.html

So I guess more like the normal gcc toolchain...


EDIT: removing those folders worked nicely.
« Last Edit: May 20th, 2013 at 9:08pm by EraYaN »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #12 - May 20th, 2013 at 9:17pm
Print Post  
Thanks, I don;t think we are that far away. 

You will read on the wiki that recent works have allowed cygwin SITL builds and Atmel have expressed an interest in helping to provide an option to use their new tool chain.

Whilst these two things don't address the library discussion they do seem connected in as much as we need an almost non-arduino build option.

I guess in vs we could start using the "Platform" which is currently set to Win32 and ignored (In Atmel we can create a custom toolchain object).

This might be a way for us to have an Arduino project without .ino files, yet allow vm to know it has to do some stuff, and also providing a clear distinction for when c++/avr/sam project properties can (or can not) be used.

I'm going to give it some more thought over the next few weeks while I polish the 1.5 (and now 1.0.5) stuff. If you think of anything else then please open a new thread as a discussion for this, it's a good topic

Thanks

other users: if you have installed 1.0.5 and do not have a new arduino robot then please delete Robot_control and Robot_Motor libraries under the arduino ide folder. You can also copy the arduino ide and point Visual Micro to whichever version you need for your project. If you are one of the lucky few that have an early release of a  new arduino robot then delete all the other libraries except the two "Robot" libs
« Last Edit: May 20th, 2013 at 9:20pm by Tim@Visual Micro »  
Back to top
IP Logged
 
EraYaN
Newbies
*
Offline


Posts: 9
Location: Netherlands
Joined: Feb 1st, 2013
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #13 - May 20th, 2013 at 9:21pm
Print Post  
I will if I come up with something more.

Also http://academic.cleardefinition.com/2012/09/21/using-c-on-the-arduino-a-mainstre... that is a good read. It begs to have the option to set avr-gcc in C++11 mode.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro includes random *.cpp files from RobotControl resulting in errors.
Reply #14 - May 20th, 2013 at 9:28pm
Print Post  
Thanks, we also have a member investigating a solution to allow debug when using straight 'c'
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint