Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export symbols from C library when compiling as a shared library on Windows #495

Open
paleolimbot opened this issue May 28, 2024 · 4 comments · Fixed by #496
Open

Export symbols from C library when compiling as a shared library on Windows #495

paleolimbot opened this issue May 28, 2024 · 4 comments · Fixed by #496

Comments

@paleolimbot
Copy link
Member

We will have to check that this is actually the problem, but it may be that the lack of any exported symbols causes a problem when creating a shared library on Windows ( mesonbuild/wrapdb#1536 (comment) ). adbc.h has:

// Storage class macros for Windows
// Allow overriding/aliasing with application-defined macros
#if !defined(ADBC_EXPORT)
#if defined(_WIN32)
#if defined(ADBC_EXPORTING)
#define ADBC_EXPORT __declspec(dllexport)
#else
#define ADBC_EXPORT __declspec(dllimport)
#endif  // defined(ADBC_EXPORTING)
#else
#define ADBC_EXPORT
#endif  // defined(_WIN32)
#endif  // !defined(ADBC_EXPORT)

https://github.com/apache/arrow-adbc/blob/main/adbc.h#L152-L164

(Although I think this is slightly incorrect in that _WIN32 should maybe be _MSC_VER to better support gcc on Windows via msys2).

@lidavidm
Copy link
Member

(Although I think this is slightly incorrect in that _WIN32 should maybe be _MSC_VER to better support gcc on Windows via msys2).

Ah, probably. I derived this from some (by now old) copy of the Arrow-C++ equivalents.

@WillAyd
Copy link
Contributor

WillAyd commented May 29, 2024

(Although I think this is slightly incorrect in that _WIN32 should maybe be _MSC_VER to better support gcc on Windows via msys2).

May also be worth checking for __CYGWIN__

https://stackoverflow.com/a/9026009/621736

@WillAyd
Copy link
Contributor

WillAyd commented May 29, 2024

@WillAyd
Copy link
Contributor

WillAyd commented May 29, 2024

Not to try and expand the scope too much but this gcc article might even help get these to work with GNU compilers:

https://gcc.gnu.org/wiki/Visibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants