0

静的ライブラリ (.lib ファイル) があります

プログラムで静的にリンクして利用したいと思います。ただし、ソース コードがないため、ヘッダー ファイルを自分で作成する必要があります。

これが私の馬鹿げた /exports の結果です

ファイルの種類: ライブラリ

Exports

 ordinal    name

      ?about@@YGHXZ (int __stdcall about(void))
      ?barcode@@YGHPAD00000000@Z (int __stdcall barcode(char *,char *,char *,char *,char *,char *,char *,char *,char *))
      ?clearbuffer@@YGHXZ (int __stdcall clearbuffer(void))
      ?closeport@@YGHXZ (int __stdcall closeport(void))
      ?downloadpcx@@YGHPAD0@Z (int __stdcall downloadpcx(char *,char *))
      ?formfeed@@YGHXZ (int __stdcall formfeed(void))
      ?nobackfeed@@YGHXZ (int __stdcall nobackfeed(void))
      ?openport@@YGHPAD@Z (int __stdcall openport(char *))
      ?printerfont@@YGHPAD000000@Z (int __stdcall printerfont(char *,char *,char *,char *,char *,char *,char *))
      ?printlabel@@YGHPAD0@Z (int __stdcall printlabel(char *,char *))
      ?sendcommand@@YGHPAD@Z (int __stdcall sendcommand(char *))
      ?setup@@YGHPAD000000@Z (int __stdcall setup(char *,char *,char *,char *,char *,char *,char *))
      ?usbportqueryprinter@@YGHXZ (int __stdcall usbportqueryprinter(void))
      ?usbportwrite@@YGHPAD@Z (int __stdcall usbportwrite(char *))
      ?windowsfont@@YGHHHHHHHPAD0@Z (int __stdcall windowsfont(int,int,int,int,int,int,char *,char *))
      ?windowsfontU@@YGHHHHHHHPAD0@Z (int __stdcall windowsfontU(int,int,int,int,int,int,char *,char *))

これらの関数を使用できるようにヘッダーファイルを作成しようとしました(1つを表示):

int __stdcall openport(char *printername);

ライブラリをプログラムに静的にリンクし、関数を呼び出そうとしましたopenportが、undefined reference to openport(char*)@4.

これが正しくリンクされるように、これを書く方法を知っている人はいますか? (または、これは良い考えですか?)

編集

も実行しましたがundname ?openport@@YGHPAD@Z、次のものが返されました。

:- "?openport@@YGHPAD@Z" の装飾解除

:- "int __stdcall openport(char *)"

つまり、適切にリンクできない可能性があります。

4

0 に答える 0