I've persuaded LAME 3.29 to run under MSVC 6. A few changes were needed

1) Changed all #if[n]def WIN32/_WIN32 checks to #if[n]def _MSC_VER. This
should also help prevent problems under non-MSVC Win32 compilers
(Borland, Cygwin, etc.)
2) In common.c at line 388 MSVC chokes on

   if (!gtkflag) {

which should presumably be changed to

#ifdef HAVEGTK
   if (!gtkflag)
#endif
   {

Following is the Makefile I was using. I use /W3 out of habit, so it
does produce quite a few warnings, mostly implicit conversion and
signed/unsigned mismatch complaints, but there are some implicit
function declarations kicking around too (mpglib/main.c: read() and
exit()). I tried to add MSVC support to the main Makefile, but nmake's
syntax and pathname conventions are so alien that it would never fly.
MSVC has no automated way to generate usable dependencies (not from the
command line, at least) so I haven't put any in. A clean build is pretty
quick anyway. ;)

# Makefile.MSVC: MSVC Makefile for LAME 3.29

PGM = lame.exe
CC = cl
LN = link
CC_OPTS = /nologo /Ox /W3
LN_OPTS = /nologo

GTK =
GTKLIBS =
SNDLIB =
LIBSNDFILE =
LIBS =
MAKEDEP =
TIMER_SWITCH =
BRHIST_SWITCH =
LIBTERMCAP =

CC_SWITCHES = $(CC_OPTS) /DNDEBUG $(DISTRIB) $(SNDLIB) $(GTK) \
              /DBS_FORMAT=BINARY $(TIMER_SWITCH) $(BRHIST_SWITCH)
LN_SWITCHES = $(LN_OPTS)

c_sources = \
  main.c \
  common.c \
  encode.c \
  formatBitstream.c \
  get_audio.c \
  huffman.c \
  l3bitstream.c \
  ieeefloat.c \
  l3psy.c \
  loop.c \
  mdct.c \
  musicin.c \
  portableio.c \
  reservoir.c \
  subs.c \
  tables.c \
  VbrTag.c \
  version.c \
  gtkanal.c \
  gpkplotting.c \
  mpglib\common.c \
  mpglib\dct64_i386.c \
  mpglib\decode_i386.c \
  mpglib\layer3.c \
  mpglib\tabinit.c \
  mpglib\interface.c \
  mpglib\main.c

OBJ = $(c_sources:.c=.obj)

.c.obj:
        @$(CC) $(CC_SWITCHES) /c $< /Fo$@

$(PGM): $(OBJ) Makefile
        @echo $(PGM)
        @$(LN) $(LN_SWITCHES) $(OBJ) $(LIBS) $(LIBSNDFILE) $(GTKLIBS) \
          $(LIBTERMCAP) /out:$(PGM)

clean:
        @-del /s *.obj *.exe

-- Mat.
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to