wjakob / nanobind

nanobind: tiny and efficient C++/Python bindings
BSD 3-Clause "New" or "Revised" License
2.29k stars 191 forks source link

[BUG]: visibility attribute gcc on windows (mingw64) #558

Closed lkeegan closed 5 months ago

lkeegan commented 5 months ago

Problem description

Building nanobind_example with gcc on Windows (mingw64) gives many warnings of the form (ci example)

warning: visibility attribute not supported in this configuration; ignored [-Wattributes]

As well as these warnings, a real project of mine also gives an import error at runtime:

ImportError: dynamic module does not define module export function (PyInit_sme)

Proposed solution

This is done in #555 which fixes both the compilation warnings seen in nanobind_example (ci example) as well as my ImportError issue in a real project.

Apologies for taking your time for a compiler you explicitly don't support - but hopefully this change is small and generic enough to be worth making. Many thanks for sharing this library!

Reproducible example code

No response

wjakob commented 5 months ago

closed via #555