Author Topic: Linking bass.dll with mingw  (Read 181 times)

oifii

  • Posts: 10
Linking bass.dll with mingw
« on: 2 Mar '24 - 13:46 »
Hi All,

I am trying to link bass.dll to a mingw project. gendef bass.dll generates an empty .def file, so I cannot successfully run dlltool to generate the .a file I need for linkage.

Could anyone supply the valid bass.def file?

Steph

Ian @ un4seen

  • Administrator
  • Posts: 25727
Re: Linking bass.dll with mingw
« Reply #1 on: 4 Mar '24 - 12:03 »
The BASS.LIB file included in the BASS package (C folder) should work with MinGW. The pre-compiled examples are built with it (using the also included makefile).

oifii

  • Posts: 10
Re: Linking bass.dll with mingw
« Reply #2 on: 6 Mar '24 - 17:12 »
Thanks for the reply Ian, my codblocks gcc won't link with .lib. Do you guys have the 64bit bass.dll free also?

oifii

  • Posts: 10
Re: Linking bass.dll with mingw
« Reply #3 on: 7 Mar '24 - 02:54 »
Success with the 64bit gcc build using 64bit bass.lib and bass.dll from the new bass audio library download.

QuentinC

  • Posts: 78
Re: Linking bass.dll with mingw
« Reply #4 on: 8 Mar '24 - 16:28 »
Hello,

You just have to rename .lib into .a and it works. I'm doing it since 15 years and it has always worked fine.
You may need to add the option --Wl,--add-stdcall-alias so that functions using stdcall convention are picked up correcttly and don't cause random crashes.

In fact, as long as the DLL exposes a C API, renaming .lib in .a almost always work in general, for BASS as well as for many other libraries. The compiler used to compile the DLL and the .lib doesn't matter.

When the API in C++, however, it isn't interoperable.