Author Topic: Trying to get darwinbots3 to build.  (Read 891 times)

Offline scood

  • Bot Neophyte
  • *
  • Posts: 44
    • View Profile
Trying to get darwinbots3 to build.
« on: October 17, 2019, 10:09:00 PM »
What version of visual studio is required.
As of this writing it does not build with visual studio 2017 because visual studio 2017 does not have a registry entry where the python build script expects it to be. Is there more detailed build instructions?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7722
    • View Profile
Re: Trying to get darwinbots3 to build.
« Reply #1 on: October 18, 2019, 08:08:21 PM »
There aren't any up to date build instructions, but build.py should work.

The default version of visual studio it looks for is 12.0, which is Visual Studio 2013.  You can change the version by adding `--version XXX` to the arguments to build.py.  You can see the different versions of Visual Studio here:  https://en.wikipedia.org/wiki/Microsoft_Visual_Studio.  It looks like 2017 is 15.0

That said, I don't know if the build script will work with newer versions of Visual Studio.
« Last Edit: October 18, 2019, 08:11:10 PM by Numsgil »

Offline scood

  • Bot Neophyte
  • *
  • Posts: 44
    • View Profile
Re: Trying to get darwinbots3 to build.
« Reply #2 on: December 29, 2019, 08:55:57 AM »
Right, the python script looks in the registry for 2017 and then fails because 2017 doesn't place any information about itself in the registry.
I modified the python build script to force it to use the actual location of what it's looking for but it seems like it still has issues getting the full project to build. Compiler errors such as "...can't find namespace vector...." I'll just try installing 2013 and see if that helps.

EDIT: seems like it just doesn't work with future versions of visual studio. builds fine with 2013
« Last Edit: December 29, 2019, 09:45:45 AM by scood »

Offline scood

  • Bot Neophyte
  • *
  • Posts: 44
    • View Profile
Re: Trying to get darwinbots3 to build.
« Reply #3 on: December 29, 2019, 10:26:26 AM »
Okay so it seems like I run the python script and everything seems to compile succesfully but when I open a project in Visual Studio 2013 and try to build it their I get the same errors that I got with 2017.

Error   1   The type or namespace name 'Azimuth' could not be found (are you missing a using directive or an assembly reference?)   C:\Users\<myname>\Documents\darwinbots\Darwinbots3\Trunk\Modules\Darwinbots3\Darwinbots3GUI\Robot.cs   8   7   Darwinbots3GUI

And a whole bunch of other errors trying to find other modules. Seems like I need to tell visual studio where to find them. I'm kind of surprised that all these projects aren't just under one solution. Would make it easier to build.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7722
    • View Profile
Re: Trying to get darwinbots3 to build.
« Reply #4 on: December 30, 2019, 05:40:41 AM »
Modules look for dependencies in Bin/Release/...  You might double check that .dlls actually got put there after you ran build.py.  Likewise in Visual Studio you might try expanding the "References" of a project and see if there's any broken links.  DarwinbotsGUI has references to Azimuth there, for instance.  I can tell you is I did a fresh checkout on my machine and it worked, but it's entirely possible there's some assumption I'm making about how stuff is setup that isn't true for everyone.  I looked through the project files and didn't see any hard coded paths, for instance, but maybe there is one somewhere being sneaky.

Alternatively you might try looking at any local changes.  It's possible that VS2017 tired to do an in-place upgrade that screwed some stuff up.

...

On purpose I didn't want to have one single solution.  It may be overkill (arguably an enterprise solution) but it helps enforce separation of concerns and makes cloning one of the individual modules on another project easier (say, if I wanted to mess around in Unity with the Math library and not with the graphics library).  I've also found that a single solution tends to dramatically inflate build times, even if it only contains projects that aren't changing, as Visual Studio has to scan for which projects have changes.  I'm ideally aiming for build times of under 1 or 2 seconds to keep iteration time high.  The downside is that it's harder to do a build of everything (though build.py is supposed to make that trivial) and I often need several visual studio instances open, one for each module.