Requirements to compile Mission Planner and Progress with VS 2012 (see details)

(Changed text 5/24/2012, 6/20/13)

You can now find all the details for compiling Mission Planner here http://dev.ardupilot.com/wiki/compile-mission-planner/

This post will probably be removed and is not current.

Here you will find information on downloading, compiling and running Mission Planner using the github source code and Visual Studio 2012.  As progress is made it will be documented for those other persons that may want to try this massive task.  

Scroll down to my reply on 5/25/2013 for the process that works after Michael updated the repository.

-----------------------------

Original post is text below..

--------------------------------

What are the minimum requirements to compile Mission Planner Using WIndows 7.

Specifically: Can I use Visual Studio 2008 and Net 3.5? (no, VS 2010 +  Net 4.0)

Should all the current files required be here: https://github.com/diydrones/MissionPlanner

Argggg!  I know a lot of other persons have asked these questions so sorry. None of the posts I have found seem to help. Spent hours researching today and in the past. Probably doing something stupid.

In case it matters here are the steps I have done:

1. Learned about Git

2. Installed Git GUI on my PC

3. Using Git GUI created a copy of https://github.com/diydrones/MissionPlanner    (1.2.52) to my PC

     This seems to have all folders ( references, Libs etc)

4. Create a new Visual Studio project using existing code files   (Visual Studio 2008)  from the Git downloaded files folder.

     Selected Visual C# as project type,  Windows Application as Output type, and named it Mission Planner.

     So Far all looks OK.  All the references etc seem to get set.

However when I compile I get one error   (Ignore all this and go to later replies... )

Error 1 Invalid Resx file. Could not find file 'C:\Users\Dennis\Documents\AMP MP Gitb\ExtLibs\BSE.Windows.Forms\Resources\ListViewItemSorter.bmp'. Line 157, position 5. C:\Users\Dennis\Documents\AMP MP Gitb\ExtLibs\BSE.Windows.Forms\Resources\Resources.resx 157

Sure enough ListViewItemSorter.bmp is not in the indicated folder.

Patching that file with a dummy bmp image (just to test build) I then get then get other errors.  One indicates I need system.drawing 4.x.x.x.    I have 2.0.x.x.x  of that an most other references.  This may indicate I need NET 4.0    and / or and newer version of Visual Studio.

Is there a tutorial for setting this up - with prerequisites?   OK ,if not, and I can get it working, I will try to do such a thing and save lots of questions in the future.

 

Dennis 

Views: 9105

Reply to This

Replies to This Discussion

VS 2010 + with .net 4.0

After two days of frustration Here is where I am:

Can anyone give me some hints.  Should I go back to Visual Studio 2010 Express or...

I get similar results using the full trial version of VS 2012 professional so am trying the Express version since It is free.

-Installed VS 2012 Desktop Express .net 4.5 etc.  (VSExp)

* Using Git GUI, Created a Git Clone from https://github.com/diydrones/MissionPlanner

* Opened the solution using VSExp

* Lots of errors. To reduce errors:

      Set to Build All Projects in the solution and then turned off signing in two projects

      Added reference directory  /lib to several of the projects to eliminate all references errors.

 *All projects in the solution build without error except  ArduPilotMega  

* For project ArduPilotMega

   - I added all reference paths and references I could find and made sense

* Down to 9 errors which I can not figure out how to solve:  


Error 17 The type or namespace name 'Amazon' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Dennis\Documents\APMMissionPlannerGit\Utilities\S3Uploader.cs 5 7 ArdupilotMega
Error 18 The type or namespace name 'Amazon' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Dennis\Documents\APMMissionPlannerGit\Utilities\S3Uploader.cs 6 7 ArdupilotMega
Error 19 The type or namespace name 'Amazon' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Dennis\Documents\APMMissionPlannerGit\Utilities\S3Uploader.cs 16 17 ArdupilotMega
Error 20 The type or namespace name 'UploadProgressArgs' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Dennis\Documents\APMMissionPlannerGit\Utilities\S3Uploader.cs 45 63 ArdupilotMega
Error 21 The type 'System.IObservable<T>' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll' and 'c:\Users\Dennis\Documents\APMMissionPlannerGit\Lib\System.Reactive.dll' C:\Users\Dennis\Documents\APMMissionPlannerGit\Controls\ConnectionStats.cs 133 24 ArdupilotMega
Error 22 The type 'System.IObservable<T>' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll' and 'c:\Users\Dennis\Documents\APMMissionPlannerGit\Lib\System.Reactive.dll' C:\Users\Dennis\Documents\APMMissionPlannerGit\Controls\ConnectionStats.cs 133 82 ArdupilotMega
Error 23 The type 'System.IObservable<T>' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll' and 'c:\Users\Dennis\Documents\APMMissionPlannerGit\Lib\System.Reactive.dll' C:\Users\Dennis\Documents\APMMissionPlannerGit\Mavlink\MAVLink.cs 157 16 ArdupilotMega
Error 24 The type 'System.IObservable<T>' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll' and 'c:\Users\Dennis\Documents\APMMissionPlannerGit\Lib\System.Reactive.dll' C:\Users\Dennis\Documents\APMMissionPlannerGit\Mavlink\MAVLink.cs 162 16 ArdupilotMega
Error 25 The type 'System.IObservable<T>' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll' and 'c:\Users\Dennis\Documents\APMMissionPlannerGit\Lib\System.Reactive.dll' C:\Users\Dennis\Documents\APMMissionPlannerGit\Controls\ConnectionStats.cs 169 67 ArdupilotMega

Every time I try to get the solution to build I end up with only a few errors and then get stuck.

Each time a different set of errors.  

Help please

If anyone else out there besides the developer(s) has tried to, or is, using Visual Studio 2012 to compile/build Mission Planner from the current git depository - I could use some help or hints or just some encouragement or comments.

Some progress building/compiling Mission Planner with vs 2012 (source from git depository download).

More updates if I make progress but for now...   Here is current status.

---------------------

Most issues are getting references set to point to the right binaries and or reference directories not set up right!   The projects .../Lib folder contains an old  system.reactive.dll not used with Net 4.0.

Ah,  It seems the Mr. Magic (Mike O) has not had time to clean some things up.  Not to worry - we want him doing important stuff.   

Perhaps when (if) I get this working, I can help or provide some information so others can be more successful.

Got rid of System.IObservable issue (last post) by removing system.reactive.dll from ../lib folder then adding directory to the Program Files (x86) installation then removing reference to sytem.reactive and adding system.reactive.core and a couple of others. This is all about Net.4.0 including some of the old Reactive items, and trying to reference the old dll.  

I finally got down to these errors

Error 17 'px4uploader.Uploader' does not contain a definition for 'currentChecksum' and no extension method 'currentChecksum' accepting a first argument of type 'px4uploader.Uploader' could be found (are you missing a using directive or an assembly reference?) C:\Users\Dennis\Documents\APMMissionPlannerGit\GCSViews\Firmware.cs 633 24 ArdupilotMega
Error 18 'px4uploader.Uploader' does not contain a definition for 'ProgressEvent' and no extension method 'ProgressEvent' accepting a first argument of type 'px4uploader.Uploader' could be found (are you missing a using directive or an assembly reference?) C:\Users\Dennis\Documents\APMMissionPlannerGit\GCSViews\Firmware.cs 645 24 ArdupilotMega
Error 19 'px4uploader.Uploader' does not contain a definition for 'LogEvent' and no extension method 'LogEvent' accepting a first argument of type 'px4uploader.Uploader' could be found (are you missing a using directive or an assembly reference?) C:\Users\Dennis\Documents\APMMissionPlannerGit\GCSViews\Firmware.cs 646 24 ArdupilotMega

I commented out the lines in Firmware.cs to see if would compile

It did, with only one error left and the project will ALMOST run without debug with build. MP hangs on first dialog (the revision dialog)  The error I get after compile (I have no idea how to approach this one)  is

Error xx The command ""..\APMMissionPlannerGit\bin\Debug\version.exe" "..\APMMissionPlannerGit\bin\Debug\ArdupilotMegaPlanner10.exe" > "...APMMissionPlannerGit\bin\Debug\version.txt"" exited with code 9009. ArdupilotMega

Will Continue flailing "What is the real problem with Firmware.cs, Etc" away unless someone has some suggestions.

As mentioned, I am documenting all the steps I do to get the solution working and if I ever get it to work I will document somehow for the community.  Surely Others have or will want to try this, If for no other reason than to try changes and perhaps contribute to the community.   

OK  A lot better progress building Mission Planner with Visual Studio 2012. (Actually Visual Studio Express for Desktop 2012 - free with registration)   I am almost there! 

Only one error left but If I ignore that error the solution runs and works about 90?%  (have not tested everything).

I have all the steps recorded so If anyone has a need to know how I did this at this time, reply to this and I will add nasty details (not cleaned up at this time)

After getting to the one error only, I had to copy a bunch of xml files from the installed MP to the folder for the Visual Studio solution for 'status' and other things to work in the Flight Data screen.

Here is the remaining error.  Can anyone - anyone - tell me what this means and or how to fix?

I have shortened the path names in the error to keep it simple  (all are in the solution folder)

Error xx The command ""..\bin\Debug\version.exe"
"..\bin\Debug\ArdupilotMegaPlanner10.exe" >
"..\bin\Debug\version.txt"" exited with code 9009.     ArdupilotMega

 Will look at the code tomorrow and see what version.exe is trying to do here.

just uploaded a new version, that should build easier.

and some instruction in readme.txt how to fix the refrences

Hi Dennis,

I looked at Michael's Readme .txt which references the VS compile 1 to 4 screens.

When you do get this working which seems imminent, I would greatly appreciate it if you could write up a step by step walk through that leads to a successfully loaded and compiled version of Mission Planner.

I have 2012 VS Pro, but if this is doable using VS Express, I will write it up for the Wiki.

From what you have said so far it looks like Express which is free is a possibility.

Are you using Windows 7? 

See the following posts. 

Wow,  I was going to try to ask how and figure out how to update the wiki and will be happy to if that makes sense. Just need to know how and where and if need permissions.  Or, I will leave that to to you.  It would be great if there is a place to at least get persons started. Let me know if you want me to take that on.

I am using Windows 7 and VS express 2012. See the following posts for details.

Michael   

Thanks a lot,  Not sure what you did but, using the process in my next post I have MP downloaded, and compiling without errors.  Had one reference I could not find when I tried to compile the 3DRRadio project.  If you have time resolving that - would be the last detail.

 IArduinoComs

Thanks again for all the work you do on MP and..  helping the community.

5/25/2013
This is the process used to download and build Mission Planner as of 5/25/2013. Please note that the process may or may not work in the future as the project is continually being updated and the developer(s) may not have had time to keep the github site configured to work with a default installation of Visual Studio.

WARNING: Use your edited or not edited version of Mission Planner at your own risk. Do not assume that it will work the same as the installed version. It may corrupt your APM, firmware, parameters or have other unknown effects. If this happens, do not call!

- You will need to install Visual Studio 2010 (VS) or 2012 and Net 4.0 (or higher?).
- Start here: http://www.microsoft.com/visualstudio/eng/downloads and download either of these:
   Visual C# 2010 Express
   Visual Studio 2012 Express for Windows Desktop (This one used for this process. The install includes Net 4.0)
   The express versions are free but you will have to sign up for a Microsoft account and get the key code to keep using it.

    I have not tested the process on VS professional.

NOTE: If you have never used Visual Studio, please do not assume the DIY Forum will be the place for answers to your learning issues. Get some training and learn how to use VS. Mission Planner is a very large project. in fact it is a complete solution with many projects. Many issues/errors/warnings will make no sense if you are new to VS so make extensive use of internet searches to find information.

- Test your VS installation and make sure it works. Do a simple example or open one of your projects.
- Be sure your installation of Mission Planner (MP) is current. Do an update or install fresh from the .msi and then do an update check.
- You will need to download the MP source code. To do this in a windows environment you will need some tools. I use GIT for windows.
This set of tools will not only download the source to your PC but will help you keep track of your changes. With proper setup and permissions from the development team you can probably even submit your changes. You will have to research how to do that.
- There are various sources for the needed tools. I got mine here: http://msysgit.github.io/
- Download and install the package and if you do not know what it does. Do some reading before you start using it.
Here are some links: http://git-scm.com/documentation  or, click the online help button in Git GUI (the Graphic User Interface for the tools you installed.)
- Now you can download the current source files (and all the supporting files) from the Mission Planner github location.
- Open Git GUI
- Click Clone Existing Repository. (This makes a copy of what is on the github web to your PC)
- In the source Location enter https://github.com/diydrones/MissionPlanner
- In the Target Directory enter the location and folder name where you want to put the download.
(Note you will want to enter the name of a folder that does not exist)
- Click [Clone]. It will work for a while without any feedback so be patient. After a while (up to 10 minutes) you will see the
Git GUI open the downloaded folder. You can exit Git GUI at this time.
- Run your installation of Visual Studio and open the downloaded MP project
- Click [File] [Open Project..]
   Browse to the home directory of the downloaded folder and click on ArdupilotMega.csproj (or the .sin file)
   After initial setup you will see warnings. Ignore those for now.
- In the VS solution Explorer, Right click the ArdupilotMega project (Icon is box with C#)
- Select Properties
- Click on Reference Paths in properties.
- In the Folder entry, browse to and select the location of the installed Mission Planner.
  This will be in C:\Program Files (x86)\APM Planner or, on 32 bit OS, systems in C:\Program Files\APM Planner
- Click the Add Folder button to put the path to the installed MP into the Reference paths box.
- Do a build. Click [BUILD] [Build Solution]
- You will probably see many errors (78 more or less) Most of these are about Namespace names that do not exist (Missing references). The File and Project are listed for each error.
- Pick the PROJECT with the most errors (in my case it was OpenTK.GLControl project
- In solution explorer, right click the properties for the project, select Reference Paths and add the path to the installed APM Planner just like you did for project ArduPilotMega. Be sure to click the [Add Folder] button.
- Build the solution to see more errors. Add the Reference Path for the other projects with namespace problems and after each build.
Here is the list of projects needing the Reference Path (as of 5/25/12)
     ArdupilotMega, OpenTK.GLControl, CsAssortedWidgets, GMap.NET.Core.
- After all errors regarding namespaces are resolved, you will probably see some errors about not importing the key file mykey.pfx (in two projects KMlib and Core.)
- For those two projects only, go to the properties, Signing, and un-check the signing box.
   (Do not un-check the signing for any of the other projects as that will cause other problems)
- Build the solution. It should build without errors at this time. If not, do a web search on the errors to see if you can find a solution. Most errors will be related to having an incompatible setup on you PC, not having the latest .dll files or .dll files not compatible with Net 4.0, etc. If this is the case it may be that the developer(s) have made a lot of progress adding new tools, new .dlls and have not yet had time to clean up the github repository so that the project (solution) will build in a default Visual Studio installation. Searching the web for information on the errors is the way to learn and fix many issues without
bothering the development team.
- Click [Debug] [Start without debugging]. Mission Planner should run. Do not connect your APM at this time. There are configuration files missing from the Github download that are only provided in the Mission Planner installation package. You will need to copy those to the Folder you are using for the visual Studio project.
- Doing a Debug will put up some warnings. You should learn what they mean and learn about debugging before you start editing.
- Here are some optional steps.
- In VS, Select [BUILD] [Configuration Manager] This will show you which projects are compiled (built) each time you do a build or re-build solution. Check 'Build' for the (three?) that are not checked:
  (3DRRadio, Updater, wix)
- Do a Build, Clean Solution then Build, Rebuild solution. You may find 3DRadio needs a reference to IArduinoComs. I could not find this reference so I unchecked building for 3DRadio for now.
- Uncheck the three option builds (3DRRadio, Updater, wix) Unless you need to change those you do not need to compile them. This is true for all the other projects you will not be editing.
- In order for your VS version of MP to function with the AMP connected, you will need to copy several files from the folder where MP is installed (C:\Program Files (x86)\APM Planner) to the folder where your VS project is located. I just copied all the .XML files from C:\Program Files (x86)\APM Planner to my project folder (replacing 5) which seemed to work.

- At this point my local VS version of MP seems to be working. I can connect to my APM, Flight Data including status works, Configuration brings up my parameters, Terminal works and Flight Planner seems to work. As mentioned before... Use your VS version at your own risk.
I personally would not try to do an actual configuration or use it to fly my quad until I test a lot of things.

For more details that may help see https://sites.google.com/site/npaecopterguide/source-codes/mission-...   I think the google site does not have the latest source but the notes are great.

- Good luck

When I build 3DRadio (or include in build configuration) I still get this error and have tried lots of using directives and assembly references but can not figure out how to eliminate this one. Any help?

Error xx The type or namespace name 'IArduinoComms' could not be found (are you missing a using directive or an assembly reference?) C:\..\Arduino\ArduinoSTK.cs 16 43 3DRRadio

Never mind, I found the solution.   

In order to build 3DRRadio, I had to make the following change to 3DRRadio/3DRRadio.csproj

- <Compile Include="..\Arduino\ArduinoComms.cs">
- <Link>Linked\ArduinoComms.cs</Link>
+ <Compile Include="..\Arduino\IArduinoComms.cs">
+ <Link>Linked\IArduinoComms.cs</Link>

Hi! I was using old version, my only error was:

Error 28 The command "" C: \ Users \ Albert \ Documents \ Visual Studio 2012 \ Projects \ Planer \ bin \ Debug \ version.exe "" C: \ Users \ Albert \ Documents \ Visual Studio 2012 \ Projects \ Planer \ bin \ Debug \ ArdupilotMegaPlanner10.exe ">" C: \ Users \ Albert \ Documents \ Visual Studio 2012 \ Projects \ planer \ bin \ Debug \ version.txt "" exited with code 9009. ArdupilotMega

The new version gives many errors related to OpenTK, I tried using OpenTK old files, but there is no improvement. Best Regards

Reply to Discussion

RSS

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service