0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

c++ builder > あるライブラリを使う > implib.exeで.dllから.libを作成 / ヘッダinclude

Last updated at Posted at 2015-09-22
動作確認
C++ Builder XE4

手順

  1. implib.exeで.dllファイルから.libファイルを作成する (*1参照)
  2. [プロジェクト]->[プロジェクトに追加]で.libファイルを追加する
  3. dll用のヘッダファイルを.cppで#includeする (SomeLbrary.hが提供されている場合、#include "SomeLibrary.h"
    )
  4. ビルドする
  5. .dllをDebugフォルダ(.exe生成場所)にコピーする

以上で[実行]でdllを使ったソフトが動いた。

ただし、DLLの作り方(種類)によっては上記がうまくいかないかもしれない。今回試した.dllでは動いた。

*1)
"C:\Program Files\Embarcadero\RAD Studio\11.0\bin\implib.exe" someApi.lib someApi.dll

参考
http://www.gesource.jp/weblog/?p=4869

手順2に関して、手順3の.hファイルに#pragma comment(lib, "MyAPI.lib")があれば、プロジェクトに.libを追加しなくてもよさそう。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?