Hello All,
I am writing one dll which gets statically linked to some lib say
library1.lib.
library1.lib exports some functions say function1. After building
library1.lib,I have linked to it by going
project->settings->linker->input. I have used some functions from it in
my DLL.
Now when I build DLL, it gives me some linker errors like

ssleay32.lib(s2_srvr.obj) : error LNK2019: unresolved external symbol
__imp__SetLastError@4 referenced in function _ssl2_accept

ssleay32.lib(ssl_cert.obj) : error LNK2019: unresolved external symbol
__imp__GetLastError@0 referenced in function
_SSL_add_dir_cert_subjects_to_stack

ssleay32.lib(ssl_lib.obj) : error LNK2019: unresolved external symbol
_time referenced in function _ssl_update_cache

like wise

Could someone shed some light on this problem ?
Thanks.

Re: Cannot link with library by Alex

Alex
Wed Sep 20 14:31:13 CDT 2006

<zehra.mb@gmail.com> wrote:
> Hello All,
> I am writing one dll which gets statically linked to some
> lib say
> library1.lib.
> library1.lib exports some functions say function1. After
> building
> library1.lib,I have linked to it by going
> project->settings->linker->input. I have used some
> functions from it in
> my DLL.
> Now when I build DLL, it gives me some linker errors like
>
> ssleay32.lib(s2_srvr.obj) : error LNK2019: unresolved
> external symbol
> __imp__SetLastError@4 referenced in function _ssl2_accept
>
> ssleay32.lib(ssl_cert.obj) : error LNK2019: unresolved
> external symbol
> __imp__GetLastError@0 referenced in function
> _SSL_add_dir_cert_subjects_to_stack
>
> ssleay32.lib(ssl_lib.obj) : error LNK2019: unresolved
> external symbol
> _time referenced in function _ssl_update_cache
>
> like wise
>
> Could someone shed some light on this problem ?


It means that linking with library1.lib is not enough. You
must provide other .LIB's where missing functions are
defined.



Re: Cannot link with library by zehra

zehra
Thu Sep 21 01:22:42 CDT 2006


Thanks for your reply.

Actually I have included all LIBs which are required for those
functions.
Is there any header file for these functions that i can include?

and i have one more question that i have used library1.lib (Which is a
third party LIB) which uses those windows function.

But the problem is that i m getting all those errors in my sample
application where i m using this library...

So can u tell me what I should do with my sample application?
Whatever changes require i have to change in my Sample Application
only..

Thanks in advance


Alex Blekhman wrote:

> <zehra.mb@gmail.com> wrote:
> > Hello All,
> > I am writing one dll which gets statically linked to some
> > lib say
> > library1.lib.
> > library1.lib exports some functions say function1. After
> > building
> > library1.lib,I have linked to it by going
> > project->settings->linker->input. I have used some
> > functions from it in
> > my DLL.
> > Now when I build DLL, it gives me some linker errors like
> >
> > ssleay32.lib(s2_srvr.obj) : error LNK2019: unresolved
> > external symbol
> > __imp__SetLastError@4 referenced in function _ssl2_accept
> >
> > ssleay32.lib(ssl_cert.obj) : error LNK2019: unresolved
> > external symbol
> > __imp__GetLastError@0 referenced in function
> > _SSL_add_dir_cert_subjects_to_stack
> >
> > ssleay32.lib(ssl_lib.obj) : error LNK2019: unresolved
> > external symbol
> > _time referenced in function _ssl_update_cache
> >
> > like wise
> >
> > Could someone shed some light on this problem ?
>
>
> It means that linking with library1.lib is not enough. You
> must provide other .LIB's where missing functions are
> defined.


Re: Cannot link with library by Alex

Alex
Thu Sep 21 05:24:12 CDT 2006

<zehra.mb@gmail.com> wrote:
> Actually I have included all LIBs which are required for
> those
> functions.
> Is there any header file for these functions that i can
> include?

Actually, those functions that you mentioned in your post
are from Kernel32.dll, so it's strange how could you miss
them. Also, `time' function is CRT standard function. All
these libs are included by default for you. Ensure that your
projects doesn't specify /NODEFAULTLIB linker option (Ignore
Default Libraries).

> and i have one more question that i have used library1.lib
> (Which is a
> third party LIB) which uses those windows function.
>
> But the problem is that i m getting all those errors in my
> sample
> application where i m using this library...
>
> So can u tell me what I should do with my sample
> application?
> Whatever changes require i have to change in my Sample
> Application
> only..

There is nothing complicated about that. You see what
function is missing (i.e., linker errors), then look up in
MSDN what the .LIB file you should add to the project.

HTH
Alex