根據 dll檔案生成 lib檔案

2021-06-27 13:21:54 字數 3832 閱讀 2980

有些linux下的開源原始碼編譯後只生成.dll檔案,為了在vc中使用,需要生成.lib檔案。

步驟如下:

1. 開啟visual studio命令提示視窗,切換到.dll路徑下

2. 使用dumpbin命令:

dumpbin /exports libzbar-0.dll >lib.txt

lib.txt內容如下:

3. 根據lib.txt建立libzbar-0.def檔案,格式如下

exports

_zbar_error_spew

_zbar_error_string

_zbar_get_error_code

zbar_decode_width

zbar_decoder_create

zbar_decoder_destroy

zbar_decoder_get_color

zbar_decoder_get_data

zbar_decoder_get_data_length

zbar_decoder_get_type

zbar_decoder_get_userdata

zbar_decoder_new_scan

zbar_decoder_reset

zbar_decoder_set_config

zbar_decoder_set_handler

zbar_decoder_set_userdata

zbar_get_addon_name

zbar_get_symbol_name

zbar_image_convert

zbar_image_convert_resize

zbar_image_copy

zbar_image_create

zbar_image_destroy

zbar_image_first_symbol

zbar_image_free_data

zbar_image_get_data

zbar_image_get_data_length

zbar_image_get_format

zbar_image_get_height

zbar_image_get_sequence

zbar_image_get_symbols

zbar_image_get_userdata

zbar_image_get_width

zbar_image_ref

zbar_image_scanner_create

zbar_image_scanner_destroy

zbar_image_scanner_enable_cache

zbar_image_scanner_get_results

zbar_image_scanner_recycle_image

zbar_image_scanner_set_config

zbar_image_scanner_set_data_handler

zbar_image_set_data

zbar_image_set_format

zbar_image_set_sequence

zbar_image_set_size

zbar_image_set_symbols

zbar_image_set_userdata

zbar_image_write

zbar_increase_verbosity

zbar_negotiate_format

zbar_parse_config

zbar_process_image

zbar_process_one

zbar_processor_create

zbar_processor_destroy

zbar_processor_force_format

zbar_processor_get_results

zbar_processor_get_userdata

zbar_processor_init

zbar_processor_is_visible

zbar_processor_request_inte***ce

zbar_processor_request_iomode

zbar_processor_request_size

zbar_processor_set_active

zbar_processor_set_config

zbar_processor_set_data_handler

zbar_processor_set_userdata

zbar_processor_set_visible

zbar_processor_user_wait

zbar_scan_image

zbar_scan_y

zbar_scanner_create

zbar_scanner_destroy

zbar_scanner_flush

zbar_scanner_get_color

zbar_scanner_get_edge

zbar_scanner_get_state

zbar_scanner_get_width

zbar_scanner_new_scan

zbar_scanner_reset

zbar_set_verbosity

zbar_symbol_first_component

zbar_symbol_get_components

zbar_symbol_get_count

zbar_symbol_get_data

zbar_symbol_get_data_length

zbar_symbol_get_loc_size

zbar_symbol_get_loc_x

zbar_symbol_get_loc_y

zbar_symbol_get_quality

zbar_symbol_get_type

zbar_symbol_next

zbar_symbol_ref

zbar_symbol_set_first_symbol

zbar_symbol_set_get_size

zbar_symbol_set_ref

zbar_symbol_xml

zbar_version

zbar_video_create

zbar_video_destroy

zbar_video_enable

zbar_video_get_fd

zbar_video_get_format

zbar_video_get_height

zbar_video_get_width

zbar_video_init

zbar_video_next_image

zbar_video_open

zbar_video_request_inte***ce

zbar_video_request_iomode

zbar_video_request_size

zbar_window_attach

zbar_window_create

zbar_window_destroy

zbar_window_draw

zbar_window_get_overlay

zbar_window_redraw

zbar_window_resize

zbar_window_set_overlay

4.使用lib命令生成.lib檔案

lib /def:libzbar-0.def

完成。

dll生成lib檔案

如何從dll檔案匯出對應的lib檔案?visual c 開發工具提供了兩個命令列工具,乙個是dumpbin.exe,另乙個是lib.exe。利用這兩個工具即可從dll匯出其對應的lib。1 在命令列執行 dumpbin exports yourdll.dll yourdll.def exports ...

根據 def檔案生成lib檔案

原文 模組定義檔案是用來描述 dll 檔案的文字格式的檔案,其格式如下 library libdll.dll dll 檔案的檔名 description 描述資訊 描述資訊,此行可以不要 exports lib add 1 函式描述 lib sub 2 函式描述 第一行 在 library 後面填 ...

通過dll生成lib庫檔案

pexports工具 1 pexports 0.47 mingw32 bin.tar.xz解壓縮 2 將解壓出的pexports.exe工具放到mingw的bin資料夾下 例如 c mingw bin 3 在windows命令列介面下,進入到dll檔案所在的路徑,執行命令 pexports.exe ...