I have a static library (.lib file)
I would like to statically link and utilize in my program. I don't have the source code, however, so I would need to write the header file myself.
Here is the result of my dumbin /exports
File Type: LIBRARY
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 *))
I tried to write a header file so I could use those functions (showing one):
int __stdcall openport(char *printername);
I have statically linked the library to my program, and tried to call the function openport
, but I get an undefined reference to openport(char*)@4
.
Does anybody know how to write this so this will link properly? (Or is this even a good idea?)
Edit
I also ran undname ?openport@@YGHPAD@Z
, which returned:
Undecoration of :- "?openport@@YGHPAD@Z"
is :- "int __stdcall openport(char *)"
Which may mean I just can't link properly.