Skip to content

How to generate import library for MinGW

Elethom edited this page Mar 22, 2021 · 10 revisions

Microsoft Windows has this thing called "import libraries" (*.lib). You don't need it in MinGW because the ld linker from GNU Binutils is smart, but MSVC still needs it for linking.

cd OPENBLAS_TOP_DIR/exports

Edit libopenblas.def. Insert LIBRARY libopenblas.dll to the head, as following.

LIBRARY libopenblas.dll

EXPORTS

   caxpy=caxpy_  @1

   caxpy_=caxpy_  @2

       ...

Then, generate the import library.

dlltool -d libopenblas.def -l libopenblas.a

Clone this wiki locally