intel / libvpl

Intel® Video Processing Library (Intel® VPL) API, dispatcher, and examples
https://intel.github.io/libvpl/
MIT License
277 stars 84 forks source link

Identifier 'StringFromGUID2' not found in dispatcher/windows/mfx_driver_store_loader.cpp #97

Closed Esvandiary closed 1 year ago

Esvandiary commented 1 year ago

Platform: Windows (same behaviour on 10 and 11) Build system: VS2022 + CMake CMake options: BUILD_DISPATCHER_ONLY=ON, BUILD_TESTS=OFF, BUILD_SHARED_LIBS=OFF

When attempting to build the oneVPL dispatcher, I receive the following error:

...\onevpl-src\dispatcher\windows\mfx_driver_store_loader.cpp(71,9): error C3861: 'StringFromGUID2': identifier not found [...\onevpl-build\dispatcher\VPL.vcxproj]

Per the docs, StringFromGUID2 is defined in combaseapi.h, and objbase.h should be included to use it.

Adding a #include <objbase.h> to the top of mfx_driver_store_loader.cpp allows the build to continue.

Esvandiary commented 1 year ago

I'm happy to make a PR if needed, assuming this is a real issue as opposed to me having a bad build setup somehow.

mav-intel commented 1 year ago

I assume you are building against the latest release? @Esvandiary Could you please share your full command line and config log? Here is the command line I am trying to reproduce with based on your information:

cmake -B _build -DBUILD_DISPATCHER_ONLY=ON -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF
cmake --build _build --verbose --config Release

Config log:

-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- The C compiler identification is MSVC 19.35.32216.1
-- The CXX compiler identification is MSVC 19.35.32216.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Default CMAKE_BUILD_TYPE not set using Release
-- API version: 2.9
-- ---------------- Configuration summary ------------------------------
-- CMake:
--   CMAKE_VERSION                   : 3.26.0
--   CMAKE_GENERATOR                 : Visual Studio 17 2022
--   CMAKE_BUILD_TOOL                : C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe
Esvandiary commented 1 year ago

Apologies, I've just discovered the problem - a definition of WIN32_LEAN_AND_MEAN was being set more widely than intended. This define was being erroneously applied to the VPL target, resulting in this error.

Very sorry for wasting your time!