unresolved symbol when building net-snmp v3

This is a discussion on unresolved symbol when building net-snmp v3 within the SNMP Coders forums, part of the Networking and Network Related category; --===============1318271697== Content-Type: multipart/alternative; boundary="0-128320997-1210152893=:20609" --0-128320997-1210152893=:20609 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 6 Days Ago
Chongkai Jiang
 
Posts: n/a
Default unresolved symbol when building net-snmp v3

--===============1318271697==
Content-Type: multipart/alternative; boundary="0-128320997-1210152893=:20609"

--0-128320997-1210152893=:20609
Content-Type: text/plain; charset=us-ascii

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. http://mobile.yahoo.com/;_ylt=Ahu06i...Dypao8Wcj9tAcJ
--0-128320997-1210152893=:20609
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>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 href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i...Dypao8Wcj9tAcJ "> Try it now.</a></body></html>
--0-128320997-1210152893=:20609--


--===============1318271697==
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
--===============1318271697==
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

--===============1318271697==--

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:29 PM.


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