利用dll生成lib

2018-4-29 C++

业务场景:

使用libvlc3.02 SDK提供的lib及dll编译运行程序,提示找不到XXX于动态链接库libvlc.dll上

解决办法:

直接利用libvlc.dll生成libvlc.lib

步骤:

dumpbin.exe:dll导出函数

C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin>dumpbin libvlc.dll /EXPORTS /OUT:libvlc.def

编辑libvlc.def只留下函数所在的行

          1    0 00002B30 libvlc_add_intf
          2    1 0000BB60 libvlc_audio_equalizer_get_amp_at_index
          3    2 0000B980 libvlc_audio_equalizer_get_band_count

python:格式化def

file = open(r"D:\Beihai\python\libvlco.def")
files = open(r"D:\Beihai\python\libvlc.def", "w")
fc = 1
while 1 :
    line = file.readline()
    if not line :
        break
    sl = line.split()
    #print sl[-1]
    nl = sl[-1] + " @ " + str(fc) + "\n"
    fc = fc + 1
    files.write(nl)
file.close()
files.close()

lib:利用def生成lib

lib /def:libvlc.def /MACHINE:IX86 /out:libvlc.lib



标签: python c++ def dll

评论(0) 浏览(351)

Powered by EMLOG Copyright @ 狼酒 版权所有. 闽ICP备14012694号-2