Net-SNMP snmpdemoapp compiling
=?windows-1257?B?QW5kcmlzIELncnpp8vA=?= <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I have tried to compile and run the first tutorial application:
snmpdemoapp.c. But i cannot make it run.
First of all - I use Borland C++Builder 6.
So, i copy-pasted the code, changing some minor things. I removed
version 3 part of the code, because first i want to make version 1
work, then i can start to work with security :)
I included the necessary files:
#include "net-snmp-config.h"
#include "net-snmp-includes.h"
and added netsnmp.lib to my project.
When i tried to compile my project, i got the following error:
[Linker Error] ... contains invalid OMF record, type 0x21 (possibly
COFF)
I used coff2omf.exe (comes together with Borland C++Builder) to make
*.lib that would be compatible with CppBuilder. When I attached the
created lib file, project compiled but i got the following results:
ack: (test.net-snmp.org)
something horrible happened!!!
i double-checked the code but couldn't find any bugs in it. Anyway,
im gonna post it, maybe i just missed something important, you will
see:
int main(int argc, char* argv[])
{
struct snmp_session session, *ss;
struct snmp_pdu *pdu;
struct snmp_pdu *response;
struct variable_list *vars;
oid anOID[MAX_OID_LEN];
size_t anOID_len = MAX_OID_LEN;
int status;
init_snmp("snmpapp");
snmp_enable_stderrlog();
snmp_sess_init( &session );
session.peername = "test.net-snmp.org";
session.version=SNMP_VERSION_1;
session.community="demopublic";
session.community_len=strlen(session.community);
session.retries=3;
session.timeout=2;
SOCK_STARTUP;
ss = snmp_open(&session);
if (!ss) {
snmp_perror("ack");
snmp_log(LOG_ERR, "something horrible happened!!!n");
getch();
return 0;
}
// Here goes the rest of the code, but it never gets that far..
I tried snmpget.exe in BIN directory on the test.net-snmp.org with
community set to demopublic and version set to 1. It timed out. So i
changed the peername to an IP address i knew was working. Result was
the same as before - something horrible happened!!.
So, if you have any suggestions how to solve this and make the code
running, or if you know that i have done something wrong, please tell
me,
I will appreciate any help.
P.S. If you need to know additional information i've forgotten to
mention - please ask me.
Advertisement:
 Inbox.lv  bezmaksas 2.5 GB (2500 MB) liela pastkastiite
 Anti-Virus un Anti-Spam aizsardziiba
 WWW.INBOX.LV
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users