[dpdk-dev] [PATCH] eal/windows: fix link error with MinGW
Dmitry Kozlyuk
dmitry.kozliuk at gmail.com
Sat Nov 21 21:47:25 CET 2020
Hi Nick,
Thanks for detailed explanation. It can be reproduced even without DPDK:
#include <windows.h>
#include <devguid.h>
int
main(int argc, char **argv) {
return (int)&GUID_DEVCLASS_NET;
}
This links with clang, but not with MinGW-w64. AFAIK, it should not link,
because INITGUID is not defined. @DmitryM, @Naty, correct me if I'm wrong.
So I agree your fix is needed.
> Sure - latest MinGW-w64 (v8.0.0 I believe, but the versioning isn't too
> clear to me!).
This is correct, MinGW-w64 version is different from GCC version, so it's
MinGW-w64 8.0.0 with GCC 8.1.0.
> [...] Arguably, it would perhaps be better to define
> INITGUID in the source files that use the guids instead of in a shared
> header, but I think this can safely be left until after 20.11 is
> finalized - if there's any impact on the code produced it will be
> negligible.
I disagree. Just because we have rte_windows.h to properly plug Windows SDK
in, other DPDK code doesn't need to care about these details. Unused GUIDs do
take some space in static libraries, but IMO it's a fair trade for ease of
development. They shouldn't have any impact on resulting binaries.
More information about the dev
mailing list