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
undefined reference to `gai_strerrorA' #10
Comments
I just realized that my MinGW distro (Msys2) does not define I think that's the problem. I guess yours does... |
another update:
|
You mean unable to trace? That's probably because If your MinGW defines
|
I wish. I'm not getting it to link.
but Tring your snippet correctly output
|
Ok I think I found something: |
I don't understand the above. And in MS-SDK 8.1+, they are also inlined (using So I'm not sure what the problem or the fix is... |
Also, check your
or ( If they're not there, it would mean they are inlined (and no need to be there. But that maybe depends on If they are there, So again, I'm not sure what the suite-all-MinGW-fix is. |
I can't perform these check right now but to clarify a few things:
removing these should define USE_DEF_FILE on the command line which leads to gai_strerror* being exported and this fixes my compile error. Of course, one could also just add -DUSE_DEF_FILE to CFLAGS instead. |
I have done that with success (using clang-cl and TDM-gcc/MinGW) But that is because I've used another MinGW that you use. Since there is so many MinGW-distros to chose from, I've not tried yours. Msys2 was it? Give me an URL or a download and I could try it. The |
Not sure if you can say the same, but I find Mingw usually behaving much better when I use the *nix approach of exporting functions and creating shared objects instead of MS's __declspec keywords.
Maybe I can make something less confusing out of it if you're cool with that. Would be quite educating as well. Anyways, Msys2 is a very actively maintained Mingw distro. It's actually a cygwin port that comes with native Mingw distros.
The way geoip.exe is executed in Makefile.MingW (without preceding it with a slash-dot), you are expecting it to be executed from cmd rather than bash (which requires a slash-dot). This could be handle like so |
|
Okay, I'll try to built ettercap again with TDM-gcc + |
I studied the man-page of And then in #if defined(__MINGW32__)
char __declspec(dllexport) *__wrap_gai_strerrorA (int err)
{
char *rc = win_strerror ((DWORD)err);
WSTRACE ("gai_strerrorA (%d) -> %s", err, rc);
return (rc);
}
wchar_t __declspec(dllexport) *__wrap_gai_strerrorW (int err)
{
static wchar_t err_buf [300];
char *err_str = win_strerror ((DWORD)err);
err_buf[0] = '\0';
MultiByteToWideChar (CP_ACP, 0, err_str, -1, err_buf, DIM(err_buf));
WSTRACE ("gai_strerrorW (%d) -> %" WCHAR_FMT, err, err_buf);
return (err_buf);
}
#endif /* __MINGW32__ && __MINGW64_VERSION_MAJOR */ Please try it. |
Another fix would be to create a new
Thus removing the |
Just as an aside. I wanted to see where the tendency is in the various mingw distros with respect the presents of gai_strerror*() in libws2_32.a
This is the default mingw32 cross distro found in Debian, Ubuntu and co. |
I'll try the wrapper. Looks fancy...
A debug build. Since the call only happens there... |
Using the wrapper workaround, |
Did you add |
Yes, I did. |
link error:
|
Try with this commit: 418408b. But some problems in AppVeyor's MinGW: Seems the last commit fixed it in AppVeyor: |
Yes, that worked. Links in just fine. |
Assume all is fixed. Closing. |
In the file ec_socket.c on line 90 there is a call to
gai_strerror()
that wsock_trace (unlike winsock) seems unable to handle.I'm only able to test this with mingw (gcc 7.2).
The text was updated successfully, but these errors were encountered: