Re: unresolved symbol when building net-snmp v3

This is a discussion on Re: unresolved symbol when building net-snmp v3 within the SNMP Coders forums, part of the Networking and Network Related category; --===============0801329337== Content-Type: multipart/alternative; boundary="0-2101606417-1210221779=:19850" --0-2101606417-1210221779=:19850 Content-Type: text/plain; ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 5 Days Ago
Chongkai Jiang
 
Posts: n/a
Default Re: unresolved symbol when building net-snmp v3

--===============0801329337==
Content-Type: multipart/alternative; boundary="0-2101606417-1210221779=:19850"

--0-2101606417-1210221779=:19850
Content-Type: text/plain; charset=us-ascii

Hi,

This problem has been solved by myself, after many many desperate tries :)

so I'm not sure I can now give the exact root cause, but some notes anyway:

1) install the ssl version of net-snmp (by default, to c:\usr)
2) install Win32OpenSSL-0_9_8g.exe, which is a developer's version. (by default, to c:\OpenSSL)
3) in Visual studio, set the linker to reference c:\usr\lib\netsnmp.lib and C:\OpenSSL\lib\VC\libeay32MD.lib

Thanks All



----- Original Message ----
From: Chongkai Jiang <chongkaijiang@yahoo.com.cn>
To: net-snmp-coders@lists.sourceforge.net
Sent: Wednesday, May 7, 2008 5:34:53 PM
Subject: unresolved symbol when building net-snmp v3


Hi guys,

I'm trying to write a C++ application using net-snmp library. it works well with snmp version 2, but with version 3, visual studio linker reports errors.

TclSNMP error LNK2001: unresolved external symbol _usmDESPrivProtocol
TclSNMP error LNK2001: unresolved external symbol _usmHMACMD5AuthProtocol

I installed an net-snmp binary version and used netsnmp.lib found in the installation's lib directory. I also installed win32OpenSSL and tried its lib files, but it didn't work.

Anyone can help me out? Thanks a lot!


netsnmp_session* GetSnmpSession(char* address) {

map <char*, netsnmp_session*> ::iterator it = snmpSessionMap.find(address);
if (it != snmpSessionMap.end()){
return it->second;
}

netsnmp_session session, *ss;

snmp_sess_init( &session );
session.peername = address;

/*
session.version = SNMP_VERSION_2c;
char* communityName = "private";

session.community = (u_char *)communityName;
session.community_len = strlen(communityName);
*/

session.version = SNMP_VERSION_3;
session.securityLevel = SNMP_SEC_LEVEL_AUTHPRIV;
session.securityName = "regTester";
session.securityNameLen = strlen(session.securityName);
session.securityAuthProto = usmHMACMD5AuthProtocol;
session.securityAuthProtoLen = sizeof(usmHMACMD5AuthProtocol)/sizeof(oid);
session.securityPrivProto = usmDESPrivProtocol;
session.securityPrivProtoLen = sizeof(usmDESPrivProtocol)/sizeof(oid);
// session.securityAuthKey = (u_char*)"regAuthPasswd";
session.securityAuthKeyLen = USM_AUTH_KU_LEN;
//session.securityPrivKey = (u_char*)"regPrivPasswd";
//session.securityPrivKeyLen = strlen(session.securityPrivKey);

generate_Ku(session.securityAuthProto,
session.securityAuthProtoLen,
(u_char *) "regAuthPasswd", strlen("regAuthPasswd"),
session.securityAuthKey,
&session.securityAuthKeyLen);

ss = snmp_open(&session); /* establish the session */

if(ss) {
snmpSessionMap.insert(SessionPair(address, ss));
}

return ss;
}

________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.


__________________________________________________ __________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i...Dypao8Wcj9tAcJ
--0-2101606417-1210221779=:19850
Content-Type: text/html; charset=us-ascii

<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:8pt"><div style="font-family: arial,helvetica,sans-serif; font-size: 8pt;">Hi,<br><br>This problem has been solved by myself, after many many desperate tries :) <br><br>so I'm not sure I can now give the exact root cause, but some notes anyway:<br><br>1) install the ssl version of net-snmp (by default, to c:\usr)<br>2) install Win32OpenSSL-0_9_8g.exe, which is a developer's version. (by default, to c:\OpenSSL)<br>3) in Visual studio, set the linker to reference c:\usr\lib\netsnmp.lib and C:\OpenSSL\lib\VC\libeay32MD.lib<br><br>Thanks All<br><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Chongkai Jiang &lt;chongkaijiang@yahoo.com.cn&gt;<br>To: net-snmp-coders@lists.sourceforge.net<br>Sent: Wednesday, May 7, 2008 5:34:53 PM<br>Subject:
unresolved symbol when building net-snmp v3<br><br><div style="font-family: arial,helvetica,sans-serif; font-size: 8pt;"><div>Hi guys,<br><br>I'm trying to write a C++ application using net-snmp library. it works well with snmp version 2, but with version 3, visual studio linker reports errors. <br><br>TclSNMP error LNK2001: unresolved external symbol _usmDESPrivProtocol<br>TclSNMP error LNK2001: unresolved external symbol _usmHMACMD5AuthProtocol<br><br>I installed an net-snmp binary version and used netsnmp.lib found in the installation's lib directory. I also installed win32OpenSSL and tried its lib files, but it didn't work.<br><br>Anyone can help me out? Thanks a lot!<br><br><br>netsnmp_session* GetSnmpSession(char* address) {<br><br>&nbsp;&nbsp;&nbsp; map &lt;char*, netsnmp_session*&gt; ::iterator it = snmpSessionMap.find(address);<br>&nbsp;&nbsp;&nbsp ; if (it != snmpSessionMap.end()){<br>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; return it-&gt;second;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; netsnmp_session session, *ss; <br><br>&nbsp;&nbsp;&nbsp; snmp_sess_init( &amp;session );<br>&nbsp;&nbsp;&nbsp; session.peername = address;<br><br>/*<br>&nbsp;&nbsp;&nbsp; session.version = SNMP_VERSION_2c;<br>&nbsp;&nbsp;&nbsp; char* communityName = "private";<br><br>&nbsp;&nbsp;&nbsp; session.community = (u_char *)communityName;<br>&nbsp;&nbsp;&nbsp; session.community_len = strlen(communityName);<br>*/<br><br>&nbsp;&nbsp;&nbsp; session.version = SNMP_VERSION_3;<br>&nbsp;&nbsp;&nbsp; session.securityLevel = SNMP_SEC_LEVEL_AUTHPRIV;<br>&nbsp;&nbsp;&nbsp; session.securityName = "regTester";<br>&nbsp;&nbsp;&nbsp; session.securityNameLen = strlen(session.securityName);<br>&nbsp;&nbsp;&nbsp ; session.securityAuthProto = usmHMACMD5AuthProtocol;<br>&nbsp;&nbsp;&nbsp; session.securityAuthProtoLen = sizeof(usmHMACMD5AuthProtocol)/sizeof(oid);<br>&nbsp;&nbsp;&nbsp;
session.securityPrivProto = usmDESPrivProtocol;<br>&nbsp;&nbsp;&nbsp; session.securityPrivProtoLen = sizeof(usmDESPrivProtocol)/sizeof(oid);<br>//&nbsp;&nbsp;&nbsp; session.securityAuthKey = (u_char*)"regAuthPasswd";<br>&nbsp;&nbsp;&nbsp; session.securityAuthKeyLen = USM_AUTH_KU_LEN;<br>&nbsp;&nbsp;&nbsp; //session.securityPrivKey = (u_char*)"regPrivPasswd";<br>&nbsp;&nbsp;&nbsp; //session.securityPrivKeyLen = strlen(session.securityPrivKey);<br><br>&nbsp;&nbs p;&nbsp; generate_Ku(session.securityAuthProto,<br>&nbsp;&n bsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; session.securityAuthProtoLen,<br>&nbsp;&nbsp;&nbsp ; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; (u_char *) "regAuthPasswd", strlen("regAuthPasswd"),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
session.securityAuthKey,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &amp;session.securityAuthKeyLen);<br><br>&nbsp;&nb sp;&nbsp; ss = snmp_open(&amp;session);&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* establish the session */<br><br>&nbsp;&nbsp;&nbsp; if(ss) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; snmpSessionMap.insert(SessionPair(address, ss));<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; return ss;<br>}<br></div></div><br><hr size="1">Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. <a rel="nofollow" target="_blank" href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ%20"> Try it now.</a></div></div></div><br>

<hr size=1>Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i...Dypao8Wcj9tAcJ "> Try it now.</a></body></html>
--0-2101606417-1210221779=:19850--


--===============0801329337==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757...un.com/javaone
--===============0801329337==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

--===============0801329337==--

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:26 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0