allegro_flare icon indicating copy to clipboard operation
allegro_flare copied to clipboard

Compile on Visual Studio

Open MarkOates opened this issue 9 years ago • 4 comments

It's been a while since I tried to compile on any version of MSVC. Ideally, it should compile without any warnings.

MarkOates avatar May 28 '16 14:05 MarkOates

When I get some spare time I can try to create a project in VS2015 and fix any errors. Would it be useful to also have the vs project/solution in the repo?

arvidsson avatar Sep 02 '16 12:09 arvidsson

At some point there was a VS project folder, but it was .gitignored for being too large (I believe it was really only the db cache files that were too big). Probably by v0.9 it would be good to have VS back in, at the very least no compile errors.

MarkOates avatar Sep 02 '16 16:09 MarkOates

As asked here, here's the approach I would take to setup the projects on Visual Studio. I would put multiple projects into one solution similar to how Allegro 5 does it. I would place the files in a msvc/ folder in the root of the repo, and have separate nested folders for each VS version (e.g. msvc/msvc2016/, msvc/msvc2015/, msvc/msvc2012/, etc.).

I would split the multiple projects in the solution something like this:

  • AllegroFlare - the actual library. This would compile all of the source files in source/ (while including include/), would build a single lib file, and would place that file it in the lib/ folder. For now, the library filename should include the version string and the platform, something like allegro_flare-0.8.8wip-msvc2015.lib.
  • Example Programs - One VS project per example program. The example files are all the ex_* and dev_* files in the examples/folder. I would not bother to build anything in any subdirectory of examples/, like examples/boost/, examples/curl/, examples/opencv/, examples/text_to_speech/, or examples/wip/. Those require other dependencies and/or are not expected to compile at all. This folder is in quite a state of flux and most of the examples in the examples/ root are broken or incomplete at this point, but, they all should compile.
  • Tests - These are the unit tests and require boost test to compile. These are all the test_*.cpp files in the test/ folder. Like the examples programs, it might be preferable to have each test file as as a separate project, but I'm not sure, I haven't done test-driven development in MSVC and am not sure what the convention is for this. :)

The AllegroFlare library is really the most important part. The other projects can be attempted only if you're feeling brave. For these, I would probably have a single property sheet that could be used to link the appropriate AllegroFlare libraries and include the header files so you wouldn't have to do all of them manually in each project.

MarkOates avatar Sep 14 '16 00:09 MarkOates

Just prior to posting the above comment, I moved some files around in the examples/ folder to make it a lot easier. So be sure to get a fresh pull.

allegro_flare 2016-09-13 20-49-06

😊

MarkOates avatar Sep 14 '16 00:09 MarkOates