Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

net-snmp error using MS VC++

65 views
Skip to first unread message

Ian Dineen

unread,
Mar 13, 2006, 10:06:53 AM3/13/06
to
hi all, i'm getting the following errors when compiling sample code in =
Microsoft Visual Studio 6 C++, ive compiled the net-snmp libraries, and =
i am able to use the supplied executables (eg. snmpget.exe) from the =
command line with no problems.
I've changed the setting of VC++ as according the the readme.win32 file =
but with no success.
here is the errors which i get when compiling the sample code for a =
snmpget request.
=20
.obj : error LNK2001: unresolved external symbol _winsock_cleanup
.obj : error LNK2001: unresolved external symbol _snmp_close
.obj : error LNK2001: unresolved external symbol _snmp_free_pdu
.obj : error LNK2001: unresolved external symbol _snmp_errstring
.obj : error LNK2001: unresolved external symbol _print_variable
.obj : error LNK2001: unresolved external symbol _snmp_synch_response
.obj : error LNK2001: unresolved external symbol _snmp_add_null_var
.obj : error LNK2001: unresolved external symbol _read_objid
.obj : error LNK2001: unresolved external symbol _snmp_pdu_create
.obj : error LNK2001: unresolved external symbol _snmp_log
.obj : error LNK2001: unresolved external symbol _snmp_perror
.obj : error LNK2001: unresolved external symbol _snmp_open
.obj : error LNK2001: unresolved external symbol _winsock_startup
.obj : error LNK2001: unresolved external symbol _snmp_sess_init
.obj : error LNK2001: unresolved external symbol _init_snmp
=20
any help is much appreciated.
Thanks=20
ian


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Net-snmp-coders mailing list
Net-snm...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Steve Friedl

unread,
Mar 13, 2006, 10:13:41 AM3/13/06
to
On Mon, Mar 13, 2006 at 03:04:03PM -0000, Ian Dineen wrote:
> hi all, i'm getting the following errors when compiling sample code in Microsoft Visual Studio 6 C++, ive compiled the net-snmp libraries, and i am able to use the supplied executables (eg. snmpget.exe) from the command line with no problems.
> I've changed the setting of VC++ as according the the readme.win32 file but with no success.
> here is the errors which i get when compiling the sample code for a snmpget request.

>
> .obj : error LNK2001: unresolved external symbol _winsock_cleanup
> .obj : error LNK2001: unresolved external symbol _snmp_close
> .obj : error LNK2001: unresolved external symbol _snmp_free_pdu
> .obj : error LNK2001: unresolved external symbol _snmp_errstring
> .obj : error LNK2001: unresolved external symbol _print_variable
> .obj : error LNK2001: unresolved external symbol _snmp_synch_response
> .obj : error LNK2001: unresolved external symbol _snmp_add_null_var
> .obj : error LNK2001: unresolved external symbol _read_objid
> .obj : error LNK2001: unresolved external symbol _snmp_pdu_create
> .obj : error LNK2001: unresolved external symbol _snmp_log
> .obj : error LNK2001: unresolved external symbol _snmp_perror
> .obj : error LNK2001: unresolved external symbol _snmp_open
> .obj : error LNK2001: unresolved external symbol _winsock_startup
> .obj : error LNK2001: unresolved external symbol _snmp_sess_init
> .obj : error LNK2001: unresolved external symbol _init_snmp

Either you're not linking with the SNMP libraries, or you build the libraries
with a different calling convention (__stdcall) than you built the main code
(using __cdecl).

Steve

---
Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561
www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | st...@unixwiz.net

0 new messages