Fatal error LNK1107 when generating lib file from vlc dll

I followed the instructions on this site http://wiki.videolan.org/GenerateLibFromDll to create a lib file from dll. The def file is created perfectly and I edited it as suggested, but when I try to create a lib file, I get error LNK1107 for an invalid or damaged file. Any help would be appreciated.

Hi

+3
source share
1 answer

Try another way: call the function from the dll, getting a pointer with GetProcAddress;

Example: C ++ dll call

Update:

VLC media player loads as version 7zip;

I choose the path using GetProcAddress:

#include <windows.h>
#include <iostream>


int main()
{
    //VLC_PUBLIC_API const char * libvlc_get_version(void);

    //Set directory path with libvlccore.dll and libvlc.dll
    SetCurrentDirectory("C:/Program Files/VideoLAN/VLC");

    HINSTANCE hGetProcIDDLL = LoadLibrary("libvlc.dll");

    FARPROC lpfnGetProcessID = GetProcAddress(HMODULE(hGetProcIDDLL),"libvlc_get_version"); 

    if(lpfnGetProcessID == 0)
    {
        std::cout << "GetProcAddress failed";

        return 1;
    }

    typedef const char * (__stdcall * pICFUNC)(void); 

    pICFUNC MyFunction = pICFUNC(lpfnGetProcessID);

    std::cout << MyFunction() << std::endl;

    //output: 1.1.4 The Luggage

    return 0;
}

, Unicode : → → → ;

! !;)

2:

lib, cmd:

Microsoft Windows XP [ 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.

C:\Program Files\Microsoft Visual Studio 9.0\VC\bin > vcvars32.bat

C:\Program Files\Microsoft Visual Studio 9.0\VC\bin > "C:\Program \Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat" Microsoft Visual Studio 2008 x86 .

C:\Program Files\Microsoft Visual Studio 9.0\VC\bin > dumpbin.exe/exports "D:\ \VLC\VLC-1.1.4-win32\VLC-1.1.4\libvlc.dll"

"C:\Documents and Settings\Eugene\ \Visual Studio   2008\Projects\VLCApp\VLCApp\libvlc.def"

C:\Program Files\Microsoft Visual Studio 9.0\VC\bin > lib /def: "C:\Documents and S ettings\Eugene\ \ 2008\Projects\VLCApp\VLCApp\libvlc.def" /out: "C:\Documents and \Eugene\ \ 2008\ s\VLCApp\VLCApp\libvlc.lib" /: x86 Microsoft (R) 9.00.30729.01 (C) Microsoft. .

C:\Documents and \Eugene\ \ 2008\Projects\VLCApp\VLCApp\libvlc.lib C:\Documents and \Euge ne\ \ 2008\Projects\VLCApp\VLCApp\libvlc.exp

C:\Program Files\Microsoft Visual Studio 9.0\VC\bin >

+2

Source: https://habr.com/ru/post/1770579/


All Articles