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) Compiling Arduplane 2.50 (Read 12025 times)
bassmoss
Newbies
*
Offline


Posts: 3
Location: Canberra, Australia
Joined: Dec 13th, 2011
Compiling Arduplane 2.50
Aug 19th, 2012 at 5:50am
Print Post  
Hi there,

I am having some trouble compiling the Arduplane Code using VS2010, the Visual Micro 1207.19, Arduino environment 1.0 . I think I am doing something wrong in the libraries/paths area.

Here is what I have done :

1) Download Arduplane 2.50 and put in into its own directory.
2) Copied the libraries from that directory to the Arduino 1.0 libraries directory. 
3) Ran arduino IDE and then closed it.
4) Opened VS2010.
5) Open Arduino project Arduplane.pde from the directory listed in step 1.
6) Set the board type to Ardunio Mega (1280). I have a APM 1.0.
7) Build the project.
8) I get a bunch of compile errors.

"Error      1      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\ArduPlane\ArduPlane.pde      27      
Error      2      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\FastSerial\FastSerial.h      122      
Error      3      Sketch      C:\Dickson College\arduino-1.0\hardware\arduino\cores\arduino\Print.h      48      
Error      4      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\FastSerial\FastSerial.cpp      33      
Error      5      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\FastSerial\FastSerial.h      122      
Error      6      Sketch      C:\Dickson College\arduino-1.0\hardware\arduino\cores\arduino\Print.h      48      
Error      7      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\AP_Common\AP_Param.cpp      16      
Error      8      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\FastSerial\FastSerial.h      122      
Error      9      Sketch      C:\Dickson College\arduino-1.0\hardware\arduino\cores\arduino\Print.h      48      
Error      10      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\AP_Common\AP_Var_menufuncs.cpp      13      
Error      11      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\FastSerial\FastSerial.h      122      
Error      12      Sketch      C:\Dickson College\arduino-1.0\hardware\arduino\cores\arduino\Print.h      48      
Error      13      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\AP_Common\menu.cpp      7      
Error      14      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\FastSerial\FastSerial.h      122      
Error      15      Sketch      C:\Dickson College\arduino-1.0\hardware\arduino\cores\arduino\Print.h      48      
Error      16      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\AP_GPS\AP_GPS_406.cpp      12      
Error      17      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\FastSerial\FastSerial.h      122      
Error      18      Sketch      C:\Dickson College\arduino-1.0\hardware\arduino\cores\arduino\Print.h      48      
Error      19      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\AP_GPS\AP_GPS_Auto.cpp      6      
Error      20      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\FastSerial\FastSerial.h      122      
Error      21      Sketch      C:\Dickson College\arduino-1.0\hardware\arduino\cores\arduino\Print.h      48      
Error      22      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\AP_GPS\AP_GPS_NMEA.cpp      28      
Error      23      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\FastSerial\FastSerial.h      122      
Error      24      Sketch      C:\Dickson College\arduino-1.0\hardware\arduino\cores\arduino\Print.h      48      
Error      25      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\AP_GPS\AP_GPS_UBLOX.cpp      14      
Error      26      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\FastSerial\FastSerial.h      122      
Error      27      Sketch      C:\Dickson College\arduino-1.0\hardware\arduino\cores\arduino\Print.h      48      
Error      28      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\AP_GPS\GPS.cpp      3      
Error      29      Sketch      C:\Dickson College\2012\arduplane 2.50\ArduPlane-2.50\libraries\FastSerial\FastSerial.h      122      
Error      30      Sketch      C:\Dickson College\arduino-1.0\hardware\arduino\cores\arduino\Print.h      48      
"

And there are more, but I have filled the max text limit. 

Any ideas on what I am doing wrong?

Thanks,

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling Arduplane 2.50
Reply #1 - Aug 19th, 2012 at 6:37am
Print Post  
Hello,

1)

Does it compile without error in the arduino ide? This is the first thing to try, if it fails then you can use the diy drones forum to get help.

Once it is proven to be setup properly by working in the arduino ide then vs should be happy if not then we can look into this for you.

2)
if you could email the full error text to info [at] visualmicro.com it might be useful thanks.

Look forward to hearing
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling Arduplane 2.50
Reply #2 - Aug 19th, 2012 at 6:49pm
Print Post  
Hello, i found some time this afternoon to wade through the arduplane 2.5 system. 

It compiles fine but you need to determine your sketch folder location using the arduino ide preference screen. Visual Micro uses the same setting. Whatever is defined as the sketch book location is where you must place the ardupilot "Libraries" and also where you must unpack the zip.

Here is my example. I have my arduino ide sketch folder set to:- "C:\Users\me\Documents\Arduino\Sketch Folder"

I have ardupilot libraries in:- "C:\Users\me\Documents\Arduino\Sketch Folder\Libraries"

I have ardupilot code in:- "C:\Users\me\Documents\Arduino\Sketch Folder\ArduPlane-2.50\ArduPlane"

Bad news though. The arduplane 2.5 system appears to be to large to fit on an APM1 Cry

Maybe the folks at diyd can suggest what to disable. 

It is only over the limit by about 60 bytes but they have such efficient code that it is hard to see what to disable that makes a difference.

If you find any answers I would be interested to know.

Good luck.
  
Back to top
WWW  
IP Logged
 
Martin
Newbies
*
Offline


Posts: 3
Joined: Sep 8th, 2012
Re: Compiling Arduplane 2.50
Reply #3 - Sep 9th, 2012 at 9:32am
Print Post  
I cannot get it to compile either,
I've tried placing the 2.5 release exactly like 'Administrator' says, but sketchroot folder in c:\tmp.
It worked to compile from Arduino IDE.

I get complaints about FastSerial and so on. I See that the ARDUINO definition is defined such that: wiring.h is looked for, which fails.

In the ArduPlane libraries (AP_Common.h):

// Get the common arduino functions
#if defined(ARDUINO) && ARDUINO >= 100
     #include "Arduino.h"
#else
     #include "wiring.h"
#endif

My errorlist:
Compiling 'ArduPlane' for 'Arduino Mega 2560 or Mega ADK'
BetterStream.h : In file included from
FastSerial.h : from
ArduPlane.pde : from
AP_Common.h : No such file or directory
ArduPlane.pde : In file included from
I2C.h : No such file or directory
ArduPlane.pde : In file included from
FastSerial.h : write(uint8_t)'
Print.h : write(uint8_t)'
ArduPlane.pde : In file included from
I2C.h : 'boolean' has not been declared

I get 411 errors thereafter...

Has anyone successfully compiled the ArduPlane software or other ArduPilot project with visualmicro(other than Administrator), and can provide a step by step guide?

Any special things todo?. I could elaborate my failing procedure more if that would help.
« Last Edit: Sep 9th, 2012 at 10:04am by Martin »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling Arduplane 2.50
Reply #4 - Sep 9th, 2012 at 11:23am
Print Post  
Hello, yes other people have compiled ap okay.

Please close visual studio and re-install the visual micro add-in. Select the uninstall option then install again

Thanks

« Last Edit: Sep 9th, 2012 at 11:33am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling Arduplane 2.50
Reply #5 - Sep 9th, 2012 at 2:50pm
Print Post  
Forgot to say, you need to be using arduino 1.0.1 or higher which does not need the diyd relax patch. 

If you are using the relax patch from diyd the version in the patch is wrong and vm uses the version but arduino doesn't need to so that is a difference. This is why wiring.h can be incorrectly included as per your example

In the meantime you can get around compile errors by switching on the "External Editor" checkbox in the Arduino ide. This puts arduino into read-only mode and allows the sketch to be open in both visual studio and arduino at the same time. When you click compile in arduino the changes from vs will be auto detected.

You should be able to get the compile working without a problem, the suggestion about the external checkbox is just to reduce fustration and get you going.

Here is a recent post about vm on diyd, Seth seems to be compiling okay Smiley

http://diydrones.com/group/learning-to-program-the-ardupilot-mega/forum/topics/u...
« Last Edit: Sep 9th, 2012 at 2:53pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling Arduplane 2.50
Reply #6 - Sep 10th, 2012 at 2:53pm
Print Post  
I should also add that the version.txt in the "[ArduinoIDE]\Libs" folder is where Visual Microreads the arduino version from.

Please confirm what is in that file in your arduino installation

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling Arduplane 2.50
Reply #7 - Sep 10th, 2012 at 2:56pm
Print Post  
@Martin As concerns step by step guide, if it works in the arduino ide and your visual micro options point to the same ide (arduino.exe) then you have configured the system correctly. 

It's a very simple system so this problem will be easily overcome. From your error it looks like a simple version problem but I always keep an open mind Smiley
  
Back to top
WWW  
IP Logged
 
Martin
Newbies
*
Offline


Posts: 3
Joined: Sep 8th, 2012
Re: Compiling Arduplane 2.50
Reply #8 - Sep 10th, 2012 at 6:36pm
Print Post  
Ok, thanks for all input!, Iam going to retry a few times and try different things out (noting down the steps I take)
  
Back to top
 
IP Logged
 
Martin
Newbies
*
Offline


Posts: 3
Joined: Sep 8th, 2012
Re: Compiling Arduplane 2.50
Reply #9 - Sep 10th, 2012 at 7:18pm
Print Post  
------------------------
Steps taken
------------------------

1. Install Visual Micro to: C:\Program Files\Visual Micro\Visual Micro for Arduino\ (Everyone)
2. Install Arduino 1.0.1 (from zip) into: C:\Program Files\Arduino-1.0.1
3. Clone the git repo for ArduPilot into: d:\code\Arduino\ardupilot\
4. Checkout branch ArduPlane-2.6
5. Open ArduPlane.pde from: d:\code\Arduino\ardupilot\ArduPlane\
6. In Arduino, set: d:\code\Arduino\ardupilot\ as SketchBook location in preferences
7. In Arduino, set: board: 'Arduino 2560 Mega or Mega ADK'
8. Verify/Compile Sketch: result OK, Binary sketch size: 166 760 bytes (of a 258 048 byte maximum)
9. Close Arduino IDE

10. Open Visual Studio 2010
11. Select: File->Open->Arduino Project, Browse and select: D:\code\Arduino\ardupilot\ArduPlane\ArduPlane.pde
    Visual Micro (thinks a while about included files etc)
    
12. Go into: Tools->Options->Visual Micro
    Set 'Arduino Application' = C:\Program Files\arduino-1.0.1
    
13. Unable to select boards from Tools -> Arduino (disabled menu)
14. Restart VisualStudio: Reopen ArduPlane.sln
    Visual Micro (Parsing included files, acanning additional...)

15. In Tools->Arduino, set: board: 'Arduino 2560 Mega or Mega ADK' (restart helped)

16. Build Solution (F6)
    Compiling 'ArduPlane' for 'Arduino Mega 2560 or Mega ADK'
    Binary sketch size: 166760 bytes (of a 258048 byte maximum) (41,2673603 secs)

Great success!

I Believe my problem was using Arduino v1.0 not 1.0.1!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling Arduplane 2.50
Reply #10 - Sep 10th, 2012 at 7:30pm
Print Post  
Excellent. Thanks very much for the great feedback!
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint