-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG]: strdup cannot be found on Cygwin #4999
Comments
pybind11/include/pybind11/pybind11.h Lines 116 to 120 in 39e65e1
My best guess (with no windows box handy to test it on) is that Cygwin also requires the The other option would be the inverse, that it is getting |
Cygwin /usr/include/string.h: #if __MISC_VISIBLE || __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 4
char *strdup (const char *) __malloc_like __result_use_check;
#endif Cygwin /usr/include/python3.9/pyconfig.h: /* Define to activate features from IEEE Stds 1003.1-2008 */
#define _POSIX_C_SOURCE 200809L Maybe a
Given the first pybind11 example in the documentation is #include <pybind11/pybind11.h>
int add(int i, int j) {
return i + j;
}
PYBIND11_MODULE(example, m) {
m.doc() = "pybind11 example plugin"; // optional module docstring
m.def("add", &add, "A function that adds two numbers");
} either the docs need to change to have This was the cause of scipy/scipy#17925, which was fixed in scipy/scipy#18049 |
Chasing includes: the first include in pybind11/include/pybind11/detail/common.h Lines 226 to 233 in 8b48ff8
are the two actual included files before Python.h on line 274. This does not seem to be a problem on the pybind side.
On the other hand, matplotlib's |
Closed by matplotlib/matplotlib#27821? |
This could do with a documentation note at least? I don't think it's mentioned anywhere that |
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
2.11.1
Problem description
On our test builds with Cygwin, some newly added pybind11 code is no longer compiling due to
strdup
:Unfortunately, the compiler backtrace only seems to point to the
#include
line, so I'm sure what exact code triggers this.Reproducible example code
No response
Is this a regression? Put the last known working version here if it is.
Not a regression
The text was updated successfully, but these errors were encountered: