SNMP Libraries

I need to create a basic program for work that utilizes the snmpget command. It needs to be usable in both windows and solaris as our clients use both. What's the best snmp library to use? I tried to download a number of them but I can't even get the sample programs that come with them to compile due to linker errors.

I know what snmp commands that I need to use, it's just a matter of getting a working library so that I can compile a C++ program that the clients could install to do an automatic diagnostic test rather than manually typing the commands at cmd prompt.

and I'm getting the error:
fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
which from the research I've done (which only involved googling sys/time.h), it seems as though that's a unix header. Like I said before, this program needs to work in both Solaris and Windows but for now I'm just developing in Windows.

it does build on FreeBSD. and therefore should build on Solaris.
here is an extract of the make output.
as you can see from it, the Makefile does not have anything special.
are you using the wrong Makefile? or a different version of the library?

I'm really not sure to be honest. Here's the code that I'm using to try to test it. This code can be found in the rather outdated documentation for SNMP++. The OID and IP address are different in the documentation, but that shouldn't affect the compiling.

are you having -D__unix -I <include dirs> etc in your Makefile. if not, you could perhaps copy the preprocessor defines and compiler switches from the Makefile which came with the tarball.

instead of -D__unix, you would probably require a -DWIN32 on windows. do you have it? and for lines like this one typedef SOCKET SnmpSocket; , you would probably need the platform SDK headers in your include path.

And as far as needing the Platform SDK headers in my include path, I set up the under Tools->Options->VC++ Directories->Include Files the directories linking to the include files in Visual Studio. Is this what you mean?

I feel so noobish. College definitely did not prepare me for my first Software Engineering Job. =X

> Do you need makefiles for a windows platform?
you need some kind of a makefile. if you are using Visual C++, the project / workspace files also act as makefiles. you could set the preprocessor defines (WIN32 etc) in the project properties from the IDE. if you do not know how to do this, just add a #define WIN32 as the first line of the file you are trying to compile. before #include <snmp_pp_ext.h> > And as far as needing the Platform SDK headers in my include path, I set up the under Tools->Options->VC++ Directories->Include Files the directories linking to the include files in Visual Studio. Is this what you mean?
yes, that should be fine then. but this

i think you should look for a library with a name like libsnmp++.lib on unix, the libraries built are libsnmp++.a (static) and libsnmp++.so (shared). the one you have included is probably required too ( DES is an encryption standard).

i should have looked at the download page earlier. it does mention MS VC++7.0 Project Fileshttp://www.agentpp.com/msvc7.zip perhaps you need to build the library from source. what does the README say?

i think you would need to build the library from sources. (i can't test anything on windows; i'm on unix right now, and don't have a windows machine near me.). see what this is http://www.agentpp.com/msvc7.zip

Sigh, this is so frustrating that it's a prepackaged product and I can't get things to compile correctly.

EDIT - I fixed the problem. I forgot I had turned off thread support in one of the config files because we didn't want this program flooding the network with snmp requests so there was no need for threads, but I just turned it back on and it compiled.

I got the snmp++.lib to finally compile but it's only in the debug folder. Is this correct? My main program is still plagued with a bunch of linker errors.

The thing that sucks is our hardware supplier is already working on a fix or diagnostic program (I'm not sure which) for the media convertors which is what I'm creating a program to test. But since I'm still in training, my manager just wants me to mess around and see if I can get something working to refamiliarize myself with C++ and networking even though they won't ever use it.

Maybe C++ isn't the best option (You didn't mention this as a requirement).

If it's just a "basic program" perhaps a scripting language like python might be a better fit. I've never used it but there is the PySNMP library. If you don't have python experience, I suggest you learn it. If you know C++, it should be easy to pick up. It's often much quicker and better suited for little problems like these.

Yeah, there was a really basic PERL script that another guy here wrote a few months back which did the general thing that was wanted but since I've never worked with PERL I thought porting the script to C++ might be an easier alternative. Are PERL scripts compatible with Solaris? If so, maybe I'll just bite the bullet and try to edit his code to make it more functional. I'm assuming you can still write things to a file and such in PERL?

But I would really look into learning python. It comes in really handy for tasks like these. Like I said, if you know C++, you can be writing python code in no time (hours even). Google uses it extensively.

It doesn't hurt to be at least competent in perl, too, so I would consider editing his code.

I faced exactly the same problems discussed in the thread and followed the solutions. I could generate the snmp++.lib (in static) and snmp_pp.lib and snmp_pp.dll (in dynamic). I added them and compiled the sample program called ReceivedPower (the one mentioned in the thread) and it compiled successfully.

However when I am running it, I get the following error:

----------------------------------
ReceivedPower.exe - System Error
----------------------------------
The program can't start because snmp_pp.dll is missing from your computer. Try reinstalling the program to fix this problem.
---------------------------
OK
---------------------------

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...