Ticket #536 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

Microsoft Visual Studio 2015 compile

Reported by: stefan Owned by: et
Priority: blocker Milestone: Windows
Component: ALL modules Version: 7.9
Keywords: Cc:


Microsoft Visual Studio 2015 compile fails on Windows. Dependent on NtWin32.Mak and Win32.Mak which are no longer included. But even with these copied from a previous VS, the earlybird library fails to compile "too complex"; ring2coax & II unresolved external symbol _acrt_iob. mole, loc_wcatwc, pick_wcatwc fails because earylbird library. Issues also with eqfilter, geqproc, ewthresh, psnadsend.

One used to be able to download older versions of visual studio express from Microsoft, but no more. We want users who download the currently available Windows compiler to be able to build Earthworm.

Change History

comment:1 Changed 5 years ago by et

  • Owner changed from somebody to et
  • Status changed from new to assigned

One of the main issues is that '.obj' and '.lib' files from older versions of Visual Studio are not compatible with the 2015 version, so if any of those files are left around they can cause build errors. Some of the 'clean' directives in the "makefile.nt" files were not fully removing their files; committed modifications to fix those:

libsrc/makefile.nt: Added '.lib' files and 'libdali' target to 'clean' directive.

libsrc/libdali/makefile.nt: Fixed backslash in 'clean' directive.

libsrc/earlybird/makefile.nt: Added '.lib' files to 'clean' directive.

archiving/Makefile: Changed NT 'clean' directives to use NT_MODULES (so 'mole' project will be cleaned).

archiving/mole/ew2moledb/makefile.nt: Removed redundant 'ew2moledb.obj' from objects list.


comment:2 Changed 5 years ago by et

For 'ringtocoax' and 'ringtocoaxII', the fix is to remove '/NODEFAULTLIB' from 'linkflags' in the "makefile.nt" files. The setting seems to have no effect when building with earlier versions of Visual Studio.


comment:3 Changed 5 years ago by et

See related ticket: #542 Project 'mole' and MSVS 2015

comment:4 Changed 5 years ago by et

For the Windows build, the file "environment/tools.ini" provides global settings for Visual Studio. Since its initial commit in 2003 the file has contained two compiler flags, "/Od" and "/Op". The "/Op" flag is an obsolete setting that should definitely be removed. The "/Od" flag configures the compiler for no optimization. When the build runs there's also an "/Ox" flag (via NODEBUG and the "NtWin32.Mak/Win32.Mak" file) that would configure the compiler for full optimization, except that the "/Od" flag overrides it (resulting in many "overriding '/Ox' with '/Od'" warnings).

I think the best thing is to remove the "/Od" flag from the "environment/tools.ini" and remove the "/Ox" flag from the "Win32.Mak" file, and to use the GLOBALFLAGS setting in "environment/ew_nt.cmd" to set the "/Od" or "/Ox" flag if the user wants it. Having the default build be with neither flag set should be good (default optimization) -- unless there's a real reason for having no optimization be the default.

Also, setting "APPVER=5.02" in "environment/tools.ini" squelches multiple "invalid subsystem version number" warnings during the build.

I've added "NtWin32.Mak" and "Win32.Mak" files to a new "install_win" directory, and the "install_win" directory should be added to the INCLUDE setting in "environment/ew_nt.cmd". With this in place, the build under Visual Studio 2015 should be in good shape.


comment:5 Changed 5 years ago by et

New "environment/ew_nt.cmd" file is committed; what's in SVN should be working for Visual Studio 2015 builds. Building with the previous versions of MSVS should still be OK. The default setup is for the GLOBALFLAGS settings in "ew_nt.cmd" to include the '/Od' flag to keep the default at no optimizations. Here are the commit notes:

environment/ew_nt.cmd: Added '/Od' (and notes) to GLOBALFLAGS (to keep default no optimization); added 'include_win' directory to INCLUDE setting (for 'NtWin32.Mak' file); added sample paths for MSVS2015; removed extraneous items from PATH setting; added EW_INST_ID; reverted changes to EW_HOME, EW_VERSION and EW_RUN_DIR.


comment:6 Changed 5 years ago by et

Note that the preferred (free) version of Visual Studio to download and use is the 'Community' edition (not 'Express'), and during the install select: Visual C++ | Common Tools for Visual C++ 2015 | Microsoft Foundation Classes for C++

(The foundation classes are needed to build the 'PsnAdSend' module.)

The 'Community' edition is available here: https://www.visualstudio.com/downloads/download-visual-studio-vs


comment:7 Changed 5 years ago by et

Update: Looks like Microsoft Foundation Classes are no longer needed to build the 'PsnAdSend' module: #545

I'd say that the 'Community' version of MSVS is still preferred over the 'Express' version.


comment:8 Changed 5 years ago by et

  • Status changed from assigned to closed
  • Resolution set to fixed

The version of Earthworm in the SVN 'trunk' should now be fine for building with MSVS 2015.


Note: See TracTickets for help on using tickets.