[mps-discussion] Building on Visual Studio 7

Bruce Mitchener bruce at cubik.org
Wed Mar 2 15:19:28 GMT 2005


Hello,

I started trying to build the current release of MPS on Visual Studio 7 
with w3i3mv.nmk and ran into a couple of issues:

   w3i3mv\hi\mpm.obj
   mpm.c
   mpm.c(229) : error C2220: warning treated as error - no object file
                generated
   mpm.c(229) : warning C4295: 'digit' : array is too small to include
                a terminating null character

This is easily fixed by changing digit's size from 16 to 17. In this 
event, perhaps the following padding variable should be removed.

After that, the next error was:

   w3i3mv\hi\testlib.obj
   testlib.c
   c:\dev\mps\code\testlib.c(100) : error C2220: warning treated as error
                                    - no 'object' file generated
   c:\dev\mps\code\testlib.c(100) : warning C4702: unreachable code

And that's easily fixed by placing this at the top of testlib.c:

#ifdef _MSC_VER
#pragma warning(disable: 4702)  // unreachable code
#endif

That fix could be more localized.

Next up is a link error:

   w3i3mv\hi\mpmss.exe
   mpmss.obj : error LNK2019: unresolved external symbol _mps_class_mvff
               referenced in function _testInArena
   w3i3mv\hi\mpmss.exe : fatal error LNK1120: 1 unresolved externals

This is fixed by adding <poolmvff> to the MPM list in w3i3mv.nmk.  This 
may not be the entirely correct fix as it causes some linker warnings 
about the poolmvff object being specified more than once when building 
apss.exe, because that rule in commpost.nmk manually includes that 
object, which seems unnecssary:

$(PFM)\$(VARIETY)\apss.exe: $(PFM)\$(VARIETY)\apss.obj \
     $(PFM)\$(VARIETY)\poolmvff.obj \
     $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)

Next up:

   w3i3mv\hi\amsss.obj
   amsss.c
   c:\dev\mps\code\amsss.c(154) : error C2220: warning treated as error
                                  - no 'object' file generated
   c:\dev\mps\code\amsss.c(154) : warning C4701: local variable
                                  'ambigRoot' may be used without having
                                  been initialized
and:

   w3i3mv\hi\amsss.obj
   amsss.c
   c:\dev\mps\code\amsss.c(154) : error C2220: warning treated as error
                                  - no 'object' file generated
   c:\dev\mps\code\amsss.c(154) : warning C4701: local variable
                                  'ambigRoot' may be used without having
                                  been initialized

These can be fixed by initializing it to NULL.

Next up:

   w3i3mv\ci\poolams.obj
   poolams.c
   poolams.c(1457) : error C2220: warning treated as error - no object
                                  file generated
   poolams.c(1457) : warning C4100: 'p' : unreferenced formal parameter

I added this to work around that:

   (void *)p; /* unused */

as that was used in other sources.

Next up:

   w3i3mv\hi\awlut.exe
   awlut.obj : error LNK2019: unresolved external symbol
               _dylan_weak_dependent referenced in function _setup
   awlut.obj : error LNK2019: unresolved external symbol
               _dylan_fmt_A_weak referenced in function _setup
   awlut.obj : error LNK2019: unresolved external symbol _dylan_fmt_A
               referenced in function _setup
   fmtdytst.obj : error LNK2019: unresolved external symbol _dylan_pad
               referenced in function _dylan_init
   w3i3mv\hi\awlut.exe : fatal error LNK1120: 4 unresolved externals

In commpost.nmk, I change the rule for awlut.exe to this:

$(PFM)\$(VARIETY)\awlut.exe:  $(PFM)\$(VARIETY)\awlut.obj \
         $(DWOBJ) $(DWTESTOBJ) \
     $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ) $(LOOBJ) $(AWLOBJ)

(adding $(DWOBJ)...) That could've been solved as well by putting the 
items from DW into DWTEST in w3i3mv.mk, much like HETEST is, but doing 
that caused some linker warnings due to duplicated object files in the 
list for other executables because they had both $(DWOBJ) and $(DWTESTOBJ).

Next up:

   w3i3mv\hi\lockutw3.obj
   lockutw3.c
   lockutw3.c(34) : error C2220: warning treated as error - no object
                    file generated
   lockutw3.c(34) : warning C4554: '>>' : check operator precedence for
                    possible error; use parentheses to clarify precedence
   lockutw3.c(42) : warning C4554: '>>' : check operator precedence for
                    possible error; use parentheses to clarify precedence

I changed:

   incR(i+1 >> 1);

to:

   incR((i+1) >> 1);

And:

   w3i3mv\ti\teletest.exe
   NMAKE : fatal error U1073: don't know how to make
           'w3i3mv\hi\protcv.obj'

That's because protcv is not mentioned at all in w3i3mv.mk but is 
mentioned in commpost.nmk.  Given that protcv.c/h didn't exist and there 
was no reference to a protcv in the GNU make files, I deleted it from 
commpost.nmk.

Next:

   mv2test.c
   c:\Dev\mps\code\protocol.h(108) : error C2332: 'struct' : missing tag
                                     name
   c:\Dev\mps\code\protocol.h(108) : warning C4115: '__unnamed' : named
                                     type definition in parentheses
   c:\Dev\mps\code\protocol.h(108) : error C2236: unexpected 'struct'
                                     '__unnamed'
   c:\Dev\mps\code\protocol.h(118) : error C2332: 'struct' : missing tag
                                     name
   c:\Dev\mps\code\protocol.h(118) : warning C4115: '__unnamed' : named
                                     type definition in parentheses
   c:\Dev\mps\code\protocol.h(118) : error C2236: unexpected 'struct'
                                     '__unnamed'

This one was odd.  I had to rename the 'interface' parameter to the 
ProtocolCoerceInstMethod and ProtocolCoerceClassMethod typedefs. 
Changing it to 'iface' did the job.  I haven't any clue why.

Next:

   NMAKE : fatal error U1073: don't know how to make
           'w3i3mv\hi\locusss.exe'

So I just removed it from commpost.nmk.

And that's it!  After that, I had a complete build. I ran the test 
executables, and none reported errors, but I didn't know how to use 
bttest, teletest, or how to interpret the output from mv2test.  (The 
ones that I ran without error were abqtest, cbstest, messtest and steptest.)

I hope that someone finds this useful.

  - Bruce



More information about the MPS-discussion mailing list