After a lot of searching, reading, trying, ... . I finally managed to get the snmpdemoapp compiled using Code::Blocks (with MinGW) on Windows XP.
Here are the steps I followed. I hope they can be usefull for other peeps.
And maybe I can even get some suggestions back on how to improve this set-up
(since I'm a noob in compiling C code)
- I'm running WinXP SP2
- will use NET-SNMP v 5.7.1
STEP1: download and install mingw (mingw-get-inst-20111118.exe) and select to
install MSYS with it. I installed to c:\MinGW.
STEP2: donwload and extract net-snmp-sources. E.g. to c:\sources
STEP3: run MSYS. It's over here: c:\MinGW\msys\1.0\msys.bat
STEP4: mount the directory with the net-snmp sources ( mine is c:\sources )
like so: mount c:/sources /sources NOTICE THE SLASH is a / here !!
STEP5: now cd /sources and follow the README.Win32 instructions:
BASEDIR=c:/usr
./configure --prefix="$BASEDIR" --with-mibdir="$BASEDIR/share/snmp/mib"
--with-mib-modules="agentx disman/event-mib winExtDLL examples/example"
--disable-embedded-perl --without-perl-modules
MAKE
MAKE INSTALL
( ... takes a while to compile ... )
When it's done you can exit msys.
STEP6: install Code::Blocks (if it isn't installed yet) and start a new
project. E.g. c:\DEMO\DEMO.cbp
STEP7: change Code::Blocks settings>compiler and debugger (in the menu)
7.1 tab toolchain executables
- c compiler: gcc.exe
- linker for dynamic libraries: gcc.exe
- linker for static libraries: ar.exe
- debugger: gdb.exe
7.2 tab linker settings
Add all *.a files from C:\MinGW\lib\ to the path
STEP8: I like to copy all header files and static libraries to the project
folder. So copy c:\usr\include\net-snmp to c:\DEMO\net-snmp and c:\usr\lib
to c:\DEMO\lib
STEP9: Add the net-snmp headers and libraries to the project. In the menu
select: Project>Build options.
9.1 Go to Linker settings and add all static libraries from c:\demo\lib
9.2 Go to search directories and add the directory c:\demo to the search
directories for compiler *and* linker
STEP10: Add snmpdemoapp.c to the Code::Blocks project and compile.
NOTE1: if not yet available you may need to download msvcr70.dllm to your
C:\WINDOWS
signature.asc
Description: Digital signature
------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________ 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
