yuchi's Development Home


Create .lib file from .dll

조회 수 3517 추천 수 0 2013.02.02 06:21:25

Create .lib file from .dll

When working with 3rd party win dll’s you somtimes miss the according .lib file required to compile against it. There is a MS KB article showing how to generate a .lib file from a .dll, however the required steps are not described detailed enough I think. So here is my quick guide:

Open the Visual Studio Command Prompt, you find its shortcut in Start->Programs->Microsoft Visual Studio->Tools. Now run the dumpbin command to get a list of all exported functions of your dll:


dumpbin /exports C:\yourpath\yourlib.dll

This will print quite a bit of text to the console. However we are only interested in the functions:


ordinal hint RVA      name

1    0 00017770 jcopy_block_row
2    1 00017710 jcopy_sample_rows
3    2 000176C0 jdiv_round_up
4    3 000156D0 jinit_1pass_quantizer
5    4 00016D90 jinit_2pass_quantizer
6    5 00005750 jinit_c_coef_controller
...etc

Now copy all those function names (only the names!) and paste them into a new textfile. Name the nextfile yourlib.def and put the line “EXPORTS” at its top. My yourlib.def file looks like this:


EXPORTS
jcopy_block_row
jcopy_sample_rows
jdiv_round_up
jinit_1pass_quantizer
jinit_2pass_quantizer
jinit_c_coef_controller
...

Now from that definition file, we can finally create the .lib file. We use the “lib” tool for this, so run this command in your Visual Studio Command Prompt:


lib /def:C:\mypath\mylib.def /OUT:C:\mypath\mylib.lib


arm버젼 ws2_32.lib첨부해둠.

List of Articles
번호 제목 글쓴이 날짜sort 조회 수
181 WinRT(Windows Store App) 엔진 프로젝트 file 여치 2013-02-12 11871
180 jailbreaking된 Surface RT에 win32 D3D9엔진을 포팅해 보았다. 여치 2013-02-10 10474
179 Visual Studio 2012 Compiling Native for ARM 여치 2013-02-02 7475
» Create .lib file from .dll file 여치 2013-02-02 3517
177 windows 8에서 dxsdk 설치시 s1023에러를 뱉으며 실패할 때 여치 2013-01-12 5757
176 Windows Store App에서 D3DCompile계열함수 사용 여치 2012-12-23 3395
175 요새 작업중인 복셀 관련... file 여치 2012-11-17 6368
174 Windows Phone 8 SDK 설치 및 간단 테스트 file 여치 2012-11-04 3822
173 iOS엔진프로젝트 file 여치 2012-10-23 6097
172 hlsl ddx,ddy 여치 2012-10-12 6509
171 xcode 4.5로 업데이트 후 빌드한 바이너리 오작동 여치 2012-09-21 4013
170 iOS엔진 프로젝트 file 여치 2012-09-15 7309
169 vs2010공백 및 탭 표시 핫키 file 여치 2012-08-08 9009
168 CUDA로 구현하는 Radiosity - KD-Tree를 이용한 Ray충돌처리 [2] 여치 2012-06-09 4913
167 KD트리와 RAY충돌처리 코드 다시 만드는중 file 여치 2012-06-02 4108
166 crt힙 메시지 출력에서 xxx.cpp대신 #File error#가 뜰때 여치 2012-05-29 4937
165 Radiosity Baking 작업중 file 여치 2012-05-28 5400
164 Parallel NSight 로 CUDA디버깅시 PC가 멎을 경우 여치 2012-05-17 2246
163 NDC 2012 발표자료 - GPGPU(CUDA)를 이용한 MMOG 캐릭터 충돌처리 file 여치 2012-04-25 2859
162 NVIDIA Parallel Nsight 2.2 RC1 릴리즈 file [2] 여치 2012-04-12 2932
天安門大屠殺 六四天安門事件 反右派鬥爭 大躍進政策 文化大革命 六四天安門事件 The Tiananmen Square protests of 1989 天安門大屠殺 The Tiananmen Square Massacre 反右派鬥爭 The Anti-Rightist Struggle 大躍進政策 The Great Leap Forward 文化大革命 The Great Proletarian Cultural Revolution 人權 Human Rights 民運 Democratization 自由 Freedom 獨立 Independence 多黨制 Multi-party system 民主 言論 思想 反共 反革命 抗議 運動 騷亂 暴亂 騷擾 擾亂 抗暴 平反 維權 示威游行 法輪功 Falun Dafa 李洪志 法輪大法 大法弟子 強制斷種 強制堕胎 民族淨化 人體實驗 胡耀邦 趙紫陽 魏京生 王丹 還政於民 和平演變 激流中國 北京之春 大紀元時報 九評論共産黨 獨裁 專制 壓制 統一 監視 鎮壓 迫害 侵略 掠奪 破壞 拷問 屠殺 肅清 活摘器官 障テ社會 誘拐 買賣人口 遊進 走私 毒品 賣淫 春畫 賭博 六合彩 台灣 臺灣 Taiwan Formosa 中華民國 Republic of China 西藏 土伯特 唐古特 Tibet 達償ワ喇嘛 Dalai Lama 新疆維吾爾自治區 The Xinjiang Uyghur Autonomous Region free tibet



XE Login

天安門大屠殺 六四天安門事件 反右派鬥爭 大躍進政策 文化大革命 六四天安門事件 The Tiananmen Square protests of 1989 天安門大屠殺 The Tiananmen Square Massacre 反右派鬥爭 The Anti-Rightist Struggle 大躍進政策 The Great Leap Forward 文化大革命 The Great Proletarian Cultural Revolution 人權 Human Rights 民運 Democratization 自由 Freedom 獨立 Independence 多黨制 Multi-party system 民主 言論 思想 反共 反革命 抗議 運動 騷亂 暴亂 騷擾 擾亂 抗暴 平反 維權 示威游行 法輪功 Falun Dafa 李洪志 法輪大法 大法弟子 強制斷種 強制堕胎 民族淨化 人體實驗 胡耀邦 趙紫陽 魏京生 王丹 還政於民 和平演變 激流中國 北京之春 大紀元時報 九評論共産黨 獨裁 專制 壓制 統一 監視 鎮壓 迫害 侵略 掠奪 破壞 拷問 屠殺 肅清 活摘器官 障テ社會 誘拐 買賣人口 遊進 走私 毒品 賣淫 春畫 賭博 六合彩 台灣 臺灣 Taiwan Formosa 中華民國 Republic of China 西藏 土伯特 唐古特 Tibet 達償ワ喇嘛 Dalai Lama 新疆維吾爾自治區 The Xinjiang Uyghur Autonomous Region free tibet