smadaminov / ovs-dpdk-meson-issues

VMware Summer 2021
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

windows dpdk: unresolved external symbol __imp_VirtualAlloc2 #42

Closed williamtu closed 3 years ago

williamtu commented 3 years ago
[2/8] Linking target utilities/ovs-appctl.exe
FAILED: utilities/ovs-appctl.exe utilities/ovs-appctl.pdb
"clang"  -Wl,/MACHINE:X64 -Wl,/OUT:utilities/ovs-appctl.exe utilities/ovs-appctl.exe.p/ovs-appctl.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/no
logo" "-Wl,/DEBUG" "-Wl,/PDB:utilities\ovs-appctl.pdb" "-ladvapi32" "-lsetupapi" "-ldbghelp" "-lkernel32" "ovsdb\libovsdb.a" "lib\libopenvswi
tch.a" "C:/temp/dpdk/lib/librte_eal.a" "C:/temp/dpdk/lib/librte_ethdev.a" "C:/temp/dpdk/lib/librte_mempool.a" "C:/temp/dpdk/lib/librte_mbuf.a
" "C:/temp/dpdk/lib/librte_meter.a" "C:/temp/dpdk/lib/librte_kvargs.a" "C:/temp/dpdk/lib/librte_telemetry.a" "C:/pthread/libpthreadVC3.lib" "
-lws2_32" "-lshlwapi" "-liphlpapi" "-lwbemuuid" "-mconsole" "-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-lole32" "-loleaut32" "-luuid" "-l
comdlg32"
librte_eal.a(eal_windows_eal_memory.c.obj) : error LNK2019: unresolved external symbol __imp_VirtualAlloc2 referenced in function eal_mem_res
erve
utilities\ovs-appctl.exe : fatal error LNK1120: 1 unresolved externals
clang: error: linker command failed with exit code 1120 (use -v to see invocation)
williamtu commented 3 years ago

    # Contrary to docs, VirtualAlloc2() is exported by mincore.lib
    # in Windows SDK, while MinGW exports it by advapi32.a.
    if is_ms_linker
        add_project_link_arguments('-lmincore', language: 'c')
    endif