Skip to content

Windows build errors #1301

@lo-simon

Description

@lo-simon

Hi there

We have taken the advice in #1277 for building the Window Media Transport Library.

We want to get your expertise to confirm that our patches are sufficient to build the DPDK and the Media Transport Libraries for Windows.

Here are two areas we found in the build process.

  1. Failed with error: GUID_DEVCLASS_NETUIO is undeclared (using MIGW64).
    fix_GUID_DEVCLASS_NETUIO_for_MinGW.patch
[1/24] Compiling C object drivers/libtmp_rte_bus_pci.a.p/bus_pci_windows_pci_netuio.c.obj
FAILED: [code=1] drivers/libtmp_rte_bus_pci.a.p/bus_pci_windows_pci_netuio.c.obj
"cc" "-Idrivers/libtmp_rte_bus_pci.a.p" "-Idrivers" "-I../drivers" "-Idrivers/bus/pci" "-I../drivers/bus/pci" "-I../drivers/bus/pci/windows" "-I." "-I.." "-Iconfig" "-I../config" "-Ilib/eal/include" "-I../lib/eal/include" "-Ilib/eal/windows/include" "-I../lib/eal/windows/include" "-Ilib/eal/x86/include" "-I../lib/eal/x86/include" "-Ilib/eal/common" "-I../lib/eal/common" "-Ilib/eal" "-I../lib/eal" "-Ilib/log" "-I../lib/log" "-Ilib/kvargs" "-I../lib/kvargs" "-Ilib/pci" "-I../lib/pci" "-fdiagnostics-color=always" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-Wextra" "-std=c11" "-O3" "-include" "rte_config.h" "-Wcast-qual" "-Wdeprecated" "-Wformat" "-Wformat-nonliteral" "-Wformat-security" "-Wmissing-declarations" "-Wmissing-prototypes" "-Wnested-externs" "-Wold-style-definition" "-Wpointer-arith" "-Wsign-compare" "-Wstrict-prototypes" "-Wundef" "-Wwrite-strings" "-Wno-address-of-packed-member" "-Wno-packed-not-aligned" "-Wno-missing-field-initializers" "-Wno-zero-length-bounds" "-D_GNU_SOURCE" "-D_WIN32_WINNT=0x0A00" "-D__USE_MINGW_ANSI_STDIO" "-march=native" "-mrtm" "-DALLOW_EXPERIMENTAL_API" "-DALLOW_INTERNAL_API" "-Wno-format-truncation" "-DRTE_LOG_DEFAULT_LOGTYPE=bus.pci" -MD -MQ drivers/libtmp_rte_bus_pci.a.p/bus_pci_windows_pci_netuio.c.obj -MF "drivers/libtmp_rte_bus_pci.a.p/bus_pci_windows_pci_netuio.c.obj.d" -o drivers/libtmp_rte_bus_pci.a.p/bus_pci_windows_pci_netuio.c.obj "-c" ../drivers/bus/pci/windows/pci_netuio.c
../drivers/bus/pci/windows/pci_netuio.c: In function 'get_netuio_device_information_set':
../drivers/bus/pci/windows/pci_netuio.c:57:39: error: 'GUID_DEVINTERFACE_NETUIO' undeclared (first use in this function); did you mean 'GUID_DEVINTERFACE_NET'?
   57 |         di_set = SetupDiGetClassDevs(&GUID_DEVINTERFACE_NETUIO,
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~
      |                                       GUID_DEVINTERFACE_NET
../drivers/bus/pci/windows/pci_netuio.c:57:39: note: each undeclared identifier is reported only once for each function it appears in
../drivers/bus/pci/windows/pci_netuio.c: In function 'get_netuio_device_interface_detail':
../drivers/bus/pci/windows/pci_netuio.c:78:55: error: 'GUID_DEVINTERFACE_NETUIO' undeclared (first use in this function); did you mean 'GUID_DEVINTERFACE_NET'?
   78 |         res = SetupDiEnumDeviceInterfaces(di_set, 0, &GUID_DEVINTERFACE_NETUIO,
      |                                                       ^~~~~~~~~~~~~~~~~~~~~~~~
      |                                                       GUID_DEVINTERFACE_NET

  1. Failed with error: redefinition of clock_gettime
    To prevent the redefinition of 'clock_gettime' issue, we added a test condition in win_posix.h and win_posix.c to #define out the clock_gettime in MINGW64 build. For building the applications, we have modified the include path to include win_posix.h.
    fix-MTL-windows-MinGW.patch
$ ./build.sh
The Meson build system
Version: 1.9.1
Source dir: C:/msys64/home/gblos/Media-Transport-Library
Build dir: C:/msys64/home/gblos/Media-Transport-Library/build
Build type: native build
Program cat found: YES (C:\msys64\usr\bin/cat.EXE)
Project name: mtl
Project version: 25.02.0.REL
C compiler for the host machine: cc (gcc 15.2.0 "cc (Rev8, Built by MSYS2 project) 15.2.0")
C linker for the host machine: cc ld.bfd 2.45
Host machine cpu family: x86_64
Host machine cpu: x86_64
Message: BUILD Environment: windows
Configuring mtl_build_config.h using configuration
Library m found: YES
Library pthread found: YES
Library dl found: YES
Found pkg-config: YES (C:\msys64\mingw64\bin/pkg-config.EXE) 2.5.1
Run-time dependency json-c found: YES 0.18
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency mtl_gpu_direct found: NO (tried pkgconfig and cmake)
Run-time dependency libxdp found: NO (tried pkgconfig and cmake)
Run-time dependency libbpf found: NO (tried pkgconfig and cmake)
Message: libxdp and libbpf not found, no af_xdp backend
Run-time dependency libibverbs found: NO (tried pkgconfig and cmake)
Run-time dependency librdmacm found: NO (tried pkgconfig and cmake)
Message: libibvers and librdmacm not found, no rdma backend
Library ws2_32 found: YES
Run-time dependency libdpdk found: YES 23.11.0
Compiler for C supports arguments -mavx2: YES
Compiler for C supports arguments -mavx512vl: YES
Compiler for C supports arguments -mavx512vbmi2: YES
Build targets in project: 1

mtl 25.02.0.REL

  User defined options
    buildtype  : release
    enable_asan: false
    enable_tap : false
    enable_usdt: true

~/Media-Transport-Library/build ~/Media-Transport-Library
[1/56] Compiling C object lib/libmtl.dll.p/windows_win_posix.c.obj
FAILED: [code=1] lib/libmtl.dll.p/windows_win_posix.c.obj
"cc" "-Ilib/libmtl.dll.p" "-Ilib" "-I../lib" "-I." "-I.." "-Iinclude" "-I../include" "-I../lib/windows" "-I../dpdk/lib/eal/windows/include" "-IC:/msys64/mingw64/include/json-c" "-fdiagnostics-color=always "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-O3" "-D_DEFAULT_SOURCE" "-D__MTL_GIT__=\"4e65bd2f-dirty\"" "-D__MTL_LIB_BUILD__=\"25.02.0.REL\"" "-DALLOW_EXPERIMENTAL_API" "-include" "rte_config.h" "-arch=native" "-mrtm" "-Werror" "-Wall" "-Wunused-parameter" "-msse4.2" "-DWINDOWSENV" "-DMTL_HAS_AVX2" "-DMTL_HAS_AVX512" "-DMTL_HAS_AVX512_VBMI2" -MD -MQ lib/libmtl.dll.p/windows_win_posix.c.obj -MF "liblibmtl.dll.p/windows_win_posix.c.obj.d" -o lib/libmtl.dll.p/windows_win_posix.c.obj "-c" ../lib/windows/win_posix.c
../lib/windows/win_posix.c:60:5: error: redefinition of 'clock_gettime'
   60 | int clock_gettime(int clk_id, struct timespec* tp) {
      |     ^~~~~~~~~~~~~
In file included from C:/msys64/mingw64/include/time.h:323,
                 from ../lib/windows/win_posix.h:13,
                 from ../lib/windows/win_posix.c:5:
C:/msys64/mingw64/include/pthread_time.h:112:35: note: previous definition of 'clock_gettime' with type 'int(int,  struct timespec *)'
  112 | WINPTHREAD_CLOCK_DECL int __cdecl clock_gettime(clockid_t clock_id, struct timespec *tp)
      |                                   ^~~~~~~~~~~~~
[34/56] Compiling C object lib/libmtl.dll.p/src_st2110_st_tx_video_session.c.obj
ninja: build stopped: subcommand failed.

Thank you for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions