Board index » cppbuilder » IMPLIB'ed VC++ DLL won't link to my app

IMPLIB'ed VC++ DLL won't link to my app

I have a VC++-generated DLL on which I have run IMPLIB to generate the import library file.  I
then added the .lib to my project, but it won't link.  I get the message, "Unresolved external
'_somefunc' refereneced from myfile.obj.

TDUMP correctly displays the exported functions in the .LIB file (of which one is the one I
want).  Is there a reasonably simple procedure for figuring out what is wrong?

Any other thoughts?

- Dennis

 

Re:IMPLIB'ed VC++ DLL won't link to my app


Did you run IMPDEF on the DLL and then IMPLIB on the DEF? If you did and
it is still not working, check to make sure that the VC++ DLL uses a 'C'
style interface. If it uses a C++ interface then you are probably out of
luck because exporting classes from a DLL is not cross-compiler
compatable.

Brett

Quote
Dennis Jones wrote:

> I have a VC++-generated DLL on which I have run IMPLIB to generate the import library file.  I
> then added the .lib to my project, but it won't link.  I get the message, "Unresolved external
> '_somefunc' refereneced from myfile.obj.

Re:IMPLIB'ed VC++ DLL won't link to my app


Thanks, I found the problem.  I needed to use the '-a' option on the IMPLIB command line to prepend
the '_' to the function names in the DLL.

- Dennis

Quote
Brett Miller wrote:
> Did you run IMPDEF on the DLL and then IMPLIB on the DEF? If you did and
> it is still not working, check to make sure that the VC++ DLL uses a 'C'
> style interface. If it uses a C++ interface then you are probably out of
> luck because exporting classes from a DLL is not cross-compiler
> compatable.

> Brett

> Dennis Jones wrote:

> > I have a VC++-generated DLL on which I have run IMPLIB to generate the import library file.  I
> > then added the .lib to my project, but it won't link.  I get the message, "Unresolved external
> > '_somefunc' refereneced from myfile.obj.

Other Threads