Subj : Re: converting coff libs to omf libs To : borland.public.cpp.borlandcpp From : "trevor Arsenault" Date : Tue Sep 16 2003 06:12 pm You are right that mangling occurs so I attempted to use the _stdcall param in my export class, but I don't think it's supported with class' only functions. The same goes for the extern"C" command to prevent mangling, it would work fine if I was just exporting functions, however, I'm exporting a class which isn't supported in C. I tried to modify the Def files as you sugested (making aliases for the mangled functions, but I have two constructors and a destructor with quite similar names I can't tell which alias goes with which. Plus the class itself has a mangled name in the DEF file. I would really like to keep the class structure but I can arrange it so they are only functions and then I can follow your methods. Do you know of anyway I can construct the def file and lib file while maintaining a class structure? enclosed is the def file created from imp def ... guess' labeled with // LIBRARY MICRO2BORLAND.DLL EXPORTS ??0usbWrapper@@QAE@HH@Z @1 //class structure ??0usbWrapper@@QAE@XZ @2 //constructor no params ??1usbWrapper@@QAE@XZ @3 //constructor params ??4usbWrapper@@QAEAAV0@ABV0@@Z @4 //destructor ?recieveCommand@usbWrapper@@QAEPAEXZ @5 //recieveCommand ?sendCommand@usbWrapper@@QAEXPAE@Z @6 //sendCommand and the class def is class __declspec(dllexport) usbWrapper { public: usbWrapper(); usbWrapper(int vendorId, int productId); ~usbWrapper(); void sendCommand(unsigned char* command); unsigned char * recieveCommand(); }; so it's pretty much a guess at which function maps to which mangled name as they are not in order. Thanks for all your help Trevor "Bob Gonder" wrote in message news:4hgemv8opb3hmt9bjie58fk26joe1b4f2v@4ax.com... > trevor Arsenault wrote: > > >I created the lib using IMPLIB in Borland 5.02, then I added the lib to my > >project and set the path to find the lib, but 3 of 6 functions > >in my __declspec(dllexport)..ed class are still showing as unresolved > >externals. Could this be because the lib file does not contain the full > >definition? The file is half the size of the COFF lib...don't know the > >structure inside a lib file so I don't know if the size means anything. > > You're supposed to be able to use TDUMP on your LIB to see what > functions are in there. > I don't know if TLIB will list an import library or not. > IMPDEF is supposed to make a DEF file (text) from the DLL that you can > read/edit and then IMPLIB the DEF to a LIB also. > > So, that's how you can find out what's in there. Now, about why.... > You said these were VC++ functions, right? C++ names are normally > mangled, and AFAIK there is no standard mangling convention, so.... > Borland is probably looking for a differently mangled name than what's > in the DLL/LIB. > I think declairing the functions extern "C" on both sides whould fix > that. > > > .