How do I build with LIBMAD

Hi

I have successfully built Audacity 1.3.6 with Widgets 2.8.7 on Visual Studio C++ Express, but my version cannot import and play mp3 files.

I discovered that to do so I require libmad which I downloaded from here
http://sourceforge.net/projects/mad/files/

You get a directory called libmad containing all the source files.
Within that you get a msvc++ subdirectory containing libmad.sln

msvc converts that into a vcproj file and builds it successfully, but puts its libmad.lib into a subdirectory of the msvc++ subdirectory called Debug (because I built in debug mode).

I add this project to the main audacity project, then I edit c:audacity-src-1.3.6winconfigwin.h as in the excerpt below, commenting out the 2 lines for #undef MP3SUPPORT and #undef USE_LIBMAD.

// The Audacity source tarball does NOT come with
// any optional libraries.

// Delete the following lines if you install them manually.

//#undef MP3SUPPORT
#undef USE_FFMPEG
#undef USE_LIBFLAC
#undef USE_LIBID3TAG
#undef USE_LIBLRDF
//#undef USE_LIBMAD
#undef USE_LIBSAMPLERATE
#undef USE_LIBTWOLAME
#undef USE_LIBVORBIS
#undef USE_SLV2
#undef USE_SOUNDTOUCH
#undef EXPERIMENTAL_SCOREALIGN

When I try and build the whole Audacity project, I first have to copy libmad.lib to C:audacity-src-1.3.6windebug where all the other lib files reside. (This is a temporary measure - I realise the libmad vcproj file should probably be changed so the lib file automatically gets created in the right place).

But after copying I get these linker errors

Build Log      Build started: Project: Audacity, Configuration: Debug|Win32
 Command Lines      Creating temporary file "c:audacity-src-1.3.6winProjectsAudacityDebugRSP00000113123148.rsp" with contents
[
/OUT:"C:audacity-src-1.3.6winDebugAudacity.exe" /INCREMENTAL /LIBPATH:"C:audacity-src-1.3.6winDebug" /LIBPATH:"C:wxWidgets-2.8.7libvc_dll" /MANIFEST /MANIFESTFILE:"DebugAudacity.exe.intermediate.manifest" /NODEFAULTLIB:"dsound.lib" /DEBUG /PDB:"c:audacity-src-1.3.6windebugAudacity.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X86 filedialog.lib libsndfile.lib wxbase28d.lib wxbase28d_net.lib wxmsw28d_adv.lib wxmsw28d_core.lib wxmsw28d_html.lib wxexpatd.lib wxpngd.lib wxzlibd.lib wxjpegd.lib wxtiffd.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib oleacc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib

".DebugAboutDialog.obj"

".DebugAColor.obj"

".DebugAudacityApp.obj"

".DebugAudacityHeaders.obj"

".DebugAudioIO.obj"

".DebugAutoRecovery.obj"

".DebugBatchCommandDialog.obj"

".DebugBatchCommands.obj"

".DebugBatchProcessDialog.obj"

".DebugBenchmark.obj"

".DebugBlockFile.obj"

".DebugDependencies.obj"

".DebugDirManager.obj"

".DebugDither.obj"

".DebugEnvelope.obj"

".DebugFFmpeg.obj"

".DebugFFT.obj"

".DebugFileFormats.obj"

".DebugFileIO.obj"

".DebugFileNames.obj"

".DebugFreqWindow.obj"

".DebugHelpText.obj"

".DebugHistoryWindow.obj"

".DebugImageManipulation.obj"

".DebugInternat.obj"

".DebugInterpolateAudio.obj"

".DebugLabelDialog.obj"

".DebugLabelTrack.obj"

".DebugLangChoice.obj"

".DebugLanguages.obj"

".DebugLegacy.obj"

".DebugLoadModules.obj"

".DebugMatrix.obj"

".DebugMenus.obj"

".DebugMix.obj"

".DebugNonGuiThread.obj"

".DebugNoteTrack.obj"

".DebugPitchName.obj"

".DebugPlatformCompatibility.obj"

".DebugPrefs.obj"

".DebugPrinting.obj"

".DebugProfiler.obj"

".DebugProject.obj"

".DebugResample.obj"

".DebugRingBuffer.obj"

".DebugSampleFormat.obj"

".DebugScreenshot.obj"

".DebugSequence.obj"

".DebugShuttle.obj"

".DebugShuttleGui.obj"

".DebugShuttlePrefs.obj"

".DebugSnap.obj"

".DebugSoundActivatedRecord1.obj"

".DebugSpectrum.obj"

".DebugSplashDialog.obj"

".DebugTags.obj"

".DebugTheme.obj"

".DebugTimeDialog.obj"

".DebugTimerRecordDialog.obj"

".DebugTimeTrack.obj"

".DebugTrack.obj"

".DebugTrackArtist.obj"

".DebugTrackPanel.obj"

".DebugTrackPanelAx.obj"

".DebugUndoManager.obj"

".DebugUploadDialog.obj"

".DebugVoiceKey.obj"

".DebugWaveClip.obj"

".DebugWaveTrack.obj"

".DebugWrappedType.obj"

".DebugAmplify.obj"

".DebugAutoDuck.obj"

".DebugBassBoost.obj"

".DebugChangePitch.obj"

".DebugChangeSpeed.obj"

".DebugChangeTempo.obj"

".DebugClickRemoval.obj"

".DebugCompressor.obj"

".DebugDtmfGen.obj"

".DebugEcho.obj"

".DebugEffect.obj"

".DebugEffectCategory.obj"

".DebugEffectManager.obj"

".DebugEqualization.obj"

".DebugFade.obj"

".DebugFindClipping.obj"

".DebugInvert.obj"

".DebugLeveller.obj"

".DebugLoadEffects.obj"

".DebugNoise.obj"

".DebugNoiseRemoval.obj"

".DebugNormalize.obj"

".DebugPhaser.obj"

".DebugRepair.obj"

".DebugRepeat.obj"

".DebugReverse.obj"

".DebugSilence.obj"

".DebugSimpleMono.obj"

".DebugSimplePairedTwoTrack.obj"

".DebugSoundTouchEffect.obj"

".DebugSpikeCleaner.obj"

".DebugStereoToMono.obj"

".DebugToneGen.obj"

".DebugTruncSilence.obj"

".DebugTwoPassSimpleMono.obj"

".DebugWahwah.obj"

".DebugLoadVSTWin.obj"

".DebugVSTEffect.obj"

".DebugExport.obj"

".DebugExportCL.obj"

".DebugExportFFmpeg.obj"

".DebugExportFFmpegDialogs.obj"

".DebugExportFLAC.obj"

".DebugExportMP2.obj"

".DebugExportMP3.obj"

".DebugExportMultiple.obj"

".DebugExportOGG.obj"

".DebugExportPCM.obj"

".DebugImport.obj"

".DebugImportFFmpeg.obj"

".DebugImportFLAC.obj"

".DebugImportLOF.obj"

".DebugImportMIDI.obj"

".DebugImportMP3.obj"

".DebugImportOGG.obj"

".DebugImportPCM.obj"

".DebugImportRaw.obj"

".DebugRawAudioGuess.obj"

".DebugXMLFileReader.obj"

".DebugXMLTagHandler.obj"

".DebugXMLWriter.obj"

".DebugAudioIOPrefs.obj"

".DebugBatchPrefs.obj"

".DebugDirectoriesPrefs.obj"

".DebugFileFormatPrefs.obj"

".DebugGUIPrefs.obj"

".DebugKeyConfigPrefs.obj"

".DebugMousePrefs.obj"

".DebugPrefsDialog.obj"

".DebugQualityPrefs.obj"

".DebugSmartRecordPrefs.obj"

".DebugSpectrumPrefs.obj"

".DebugThemePrefs.obj"

".DebugAButton.obj"

".DebugASlider.obj"

".DebugAttachableScrollBar.obj"

".DebugErrorDialog.obj"

".DebugExpandingToolBar.obj"

".DebugGrabber.obj"

".DebugGrid.obj"

".DebugHtmlWindow.obj"

".DebugImageRoll.obj"

".DebugLinkingHtmlWindow.obj"

".DebugMeter.obj"

".DebugMultiDialog.obj"

".DebugProgressDialog.obj"

".DebugRuler.obj"

".DebugTimeTextCtrl.obj"

".Debugtreebook.obj"

".DebugWarning.obj"

".Debugaudacity.res"

".DebugLoadNyquist.obj"

".DebugNyquist.obj"

".DebugCommandManager.obj"

".DebugKeyboard.obj"

".DebugLegacyAliasBlockFile.obj"

".DebugLegacyBlockFile.obj"

".DebugODDecodeBlockFile.obj"

".DebugODPCMAliasBlockFile.obj"

".DebugPCMAliasBlockFile.obj"

".DebugSilentBlockFile.obj"

".DebugSimpleBlockFile.obj"

".DebugLadspaEffect.obj"

".DebugLoadLadspa.obj"

".DebugControlToolBar.obj"

".DebugDeviceToolBar.obj"

".DebugEditToolBar.obj"

".DebugMeterToolBar.obj"

".DebugMixerToolBar.obj"

".DebugSelectionBar.obj"

".DebugToolBar.obj"

".DebugToolDock.obj"

".DebugToolManager.obj"

".DebugToolsToolBar.obj"

".DebugTranscriptionToolBar.obj"

".DebugLoadVamp.obj"

".DebugVampEffect.obj"

".DebugODComputeSummaryTask.obj"

".DebugODDecodeFlacTask.obj"

".DebugODDecodeTask.obj"

".DebugODManager.obj"

".DebugODTask.obj"

".DebugODTaskThread.obj"

".DebugODWaveTrackTaskQueue.obj"

".DebugTimeSender.obj"

".DebugAudacity.exe.embed.manifest.res"
]
Creating command line "link.exe @"c:audacity-src-1.3.6winProjectsAudacityDebugRSP00000113123148.rsp" /NOLOGO /ERRORREPORT:PROMPT"
 Output Window      Linking...
libcmtd.lib(atox.obj) : error LNK2005: _atoi already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(strtol.obj) : error LNK2005: _strtol already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(setlocal.obj) : error LNK2005: _setlocale already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(fpinit.obj) : error LNK2005: __fltused already defined in a previous module
libcmtd.lib(fpinit.obj) : error LNK2005: __ldused already defined in a previous module
libcmtd.lib(dbgheap.obj) : error LNK2005: _malloc already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(dbgheap.obj) : error LNK2005: _calloc already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(dbgheap.obj) : error LNK2005: _realloc already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(dbgheap.obj) : error LNK2005: _free already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(dbgheap.obj) : error LNK2005: __CrtSetCheckCount already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(lconv.obj) : error LNK2005: _localeconv already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(sprintf.obj) : error LNK2005: _sprintf already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj)
libcmtd.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj)
libcmtd.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj)
libcmtd.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj)
libcmtd.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(dosmap.obj) : error LNK2005: __errno already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(getenv.obj) : error LNK2005: _getenv already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(tolower.obj) : error LNK2005: _tolower already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(dbgrptw.obj) : error LNK2005: __CrtDbgReportW already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(printf.obj) : error LNK2005: _printf already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(ismbbyte.obj) : error LNK2005: __ismbblead already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(osfinfo.obj) : error LNK2005: __get_osfhandle already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(_file.obj) : error LNK2005: ___iob_func already defined in MSVCRTD.lib(MSVCR80D.dll)
libcmtd.lib(fflush.obj) : error LNK2005: _fflush already defined in MSVCRTD.lib(MSVCR80D.dll)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strncmp already defined in libcmtd.lib(strncmp.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _atof already defined in libcmtd.lib(atof.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strchr already defined in libcmtd.lib(strchr.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _abort already defined in libcmtd.lib(abort.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _signal already defined in libcmtd.lib(winsig.obj)
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __write already defined in libcmtd.lib(write.obj)
   Creating library C:audacity-src-1.3.6winDebugAudacity.lib and object C:audacity-src-1.3.6winDebugAudacity.exp
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'libcmtd.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
C:audacity-src-1.3.6winDebugAudacity.exe : fatal error LNK1169: one or more multiply defined symbols found
 Results      Build log was saved at "file://c:audacity-src-1.3.6winProjectsAudacityDebugBuildLog.htm"
Audacity - 48 error(s), 2 warning(s)

If you compile from cvs code I think that you will find that libmad is included, so you should be able to build using the local version of libmad rather than your system version. I think the configuration option would be
./configure --with-libmad=local