I am building a project using wxWidgets compiled with MinGW g++ compiler. I was also using a component of the wxWidgets platform to play mp3 sound clips, but it has been unreliable so I went looking for another solution. I found audiere and downloaded version 1.9.4 from their website. The package contained a *.lib file and a *.dll. I was trying to add this to my project but it doesn't work (I think because the package I downloaded was compiled in MSVC).
I created a *.def file using a tool called lib2a to convert from an MSVC lib to a .a lib I could use with MinGW. The def file has these definitions...
LIBRARY "audiere.dll" EXPORTS _AdrCreateLoopPointSource@4 _AdrCreateMemoryFile@8 _AdrCreatePinkNoise@0 _AdrCreateSampleBuffer@20 _AdrCreateSampleBufferFromSource@4 _AdrCreateSquareWave@8 _AdrCreateTone@8 _AdrCreateWhiteNoise@0 _AdrEnumerateCDDevices@0 _AdrGetSampleSize@4 _AdrGetSupportedAudioDevices@0 _AdrGetSupportedFileFormats@0 _AdrGetVersion@0 _AdrOpenCDDevice@4 _AdrOpenDevice@8 _AdrOpenFile@8 _AdrOpenMIDIDevice@4 _AdrOpenSampleSource@8 _AdrOpenSampleSourceFromFile@8 _AdrOpenSound@12 _AdrOpenSoundEffect@12
When I go to link my project I get the following errors:
* MinGWUnicodeRelease/AlphaPanel.o:AlphaPanel.cpp:(.text+0x8291): undefined reference to
_imp__AdrOpenDevice@8' *** MinGWUnicodeRelease/AlphaPanel.o:AlphaPanel.cpp:(.text+0x82db): undefined reference toimp_AdrOpenSampleSource@8' * MinGWUnicodeRelease/AlphaPanel.o:AlphaPanel.cpp:(.text+0x830f): undefined reference to_imp__AdrOpenSound@12' *** MinGWUnicodeRelease/AlphaPanel.o:AlphaPanel.cpp:(.text+0x87ce): undefined reference toimp_AdrOpenDevice@8' * MinGWUnicodeRelease/AlphaPanel.o:AlphaPanel.cpp:(.text+0x8818): undefined reference to_imp__AdrOpenSampleSource@8' *** MinGWUnicodeRelease/AlphaPanel.o:AlphaPanel.cpp:(.text+0x884c): undefined reference toimp_AdrOpenSound@12'
In my code for example the function is "OpenDevice"...in the def file it is >"_AdrOpenDevice@8", but in my undefined references link error it is "imp_AdrOpenDevice@8". So my head is spinning and not sure what to do at this point.
Is there an easy way to fix the name mangling problem in the dll?
Perhaps to edit it with a binary editor to "fix" the names and get this to work with my existing code (short of downloading the entire audiere code to recompile and create the dll [if possible] using MinGW...I want to avoid this if I can)...my starting point is a *.lib file and a dll created in MSVC, but I need to use it in MinGW.
Anybody have any clues on how to do this?