Skip to content

Linux: E_NOINTERFACE when using dynamic library #3097

Closed

Description

@bsekura

I compiled dxc successfully on Linux, using master branch.
I wrote a simple c++ code that loads libdxcompiler.so.3.7 using dlopen, obtains DxcCreateInstanceProc using dlsym and attempts to create instance of IDxcUtils interface:

        const GUID CLSID_DxcLibrary = make_guid(0x6245d6af, 0x66e0, 0x48fd, 0x80, 0xb4, 0x4d, 0x27, 0x17, 0x96, 0x74, 0x8c);
        const IID IID_IDxcUtils = make_guid(0x4605C4CB, 0x2019, 0x492A, 0xAD, 0xA4, 0x65, 0xF2, 0x0B, 0xB7, 0xD6, 0x7F);

        DxcCreateInstanceProc pfn = (DxcCreateInstanceProc)fptr;
        void *pif = nullptr;
        HRESULT hr = pfn(CLSID_DxcLibrary, IID_IDxcUtils, &pif);

        printf("hr = %08x\n", hr);

The returned HRESULT is 0x80004002 (E_NOINTERFACE No such interface supported).

Interestingly, if instead I load dynamic library from build artifacts, the return code is 0 (SUCCESS).
Why would it not work anymore with the latest locally built version?
Any help appreciated.

Activity

  1. added
    linux
    on Aug 27, 2020
  2. cbitsunil commented on Sep 22, 2020

    @cbitsunil

    I'm also getting similar failure 0x80004002 when I call DXCoreCreateAdapterFactory, as
    CComPtr<IDXCoreAdapterFactory> pFactory; DXCoreCreateAdapterFactory(IID_PPV_ARGS(&pFactory));

    This is ported from windows.
    This fails only when I use this code in dynamic library. In normal cases this is success.
    Please let me know if anybody solved this issue.

  3. MarijnS95 commented on Nov 13, 2020

    @MarijnS95
    Contributor

    Interestingly, if instead I load dynamic library from build artifacts, the return code is 0 (SUCCESS).

    Noticed this issue only just now, you're likely compiling it with gcc? This is not an issue on Clang which supports msvc extensions (what you pulled from build artifacts), but on other compilers These IIDs are emulated in a way that doesn't allow your usecase.

    Should be fixed by #3062

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    linux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions