Hi Dave 
 
We have resolved all type-casting errors while compiling 
with g++ and will be posting the patch shortly. Meanwhile we are getting the 
below error while linking though  the below functions being defined in “extern 
“C”” block.

 libtool: link: g++ -fno-strict-aliasing -g -O2 -Ulinux 
-Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe 
-Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm 
-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE -o .libs/snmpd 
.libs/snmpd.o 
-Wl,-E -Wl,-rpath -Wl,/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE  
-L../snmplib/.libs -L../snmplib -L./.libs ./.libs/libnetsnmpagent.so 
-L/usr/local/lib -L/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE 
./.libs/libnetsnmpmibs.so 
/root/calient/net-snmp-5.7.1/agent/.libs/libnetsnmpagent.so -lperl -lresolv 
-lnsl -lm -lcrypt -lutil -lpthread -lc 
/root/calient/net-snmp-5.7.1/snmplib/.libs/libnetsnmp.so -ldl 
../snmplib/.libs/libnetsnmp.so  -Wl,-rpath 
-Wl,/usr/local/lib

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_table_dataset_add_row'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_get_list_node'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_agent_add_list_data'

./.libs/libnetsnmpagent.so: undefined reference to 
`boot_DynaLoader(interpreter*, cv*)'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_check_vb_int_range'

./.libs/libnetsnmpagent.so: undefined reference to 
`sysuptime_oid_len'

./.libs/libnetsnmpmibs.so: undefined reference to 
`swrun_count_processes()'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_check_vb_uint'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_swrun_entry_free'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_call_next_handler'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_extract_table_info'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_check_vb_rowstatus_value'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_table_dataset_delete_row'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_request_remove_list_data'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_free_delegated_cache'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_agent_get_list_data'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_check_vb_int'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_get_list_data'

./.libs/libnetsnmpagent.so: undefined reference to 
`sysuptime_oid'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_table_dataset_remove_and_delete_row'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_create_delegated_cache'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_free_all_list_data'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_free_agent_data_sets'

./.libs/libnetsnmpagent.so: undefined reference to 
`snmptrap_oid'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_free_request_data_sets'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_add_list_data'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_insert_tdata_row'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_check_vb_type_and_size'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_check_vb_type_and_max_size'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_check_vb_oid'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_insert_iterator_context'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_create_data_list'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_handler_check_cache'

./.libs/libnetsnmpmibs.so: undefined reference to 
`restart_hook'

./.libs/libnetsnmpagent.so: undefined reference to 
`snmptrap_oid_len'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_extract_iterator_context'

./.libs/libnetsnmpagent.so: undefined reference to 
`netsnmp_request_add_list_data'

./.libs/libnetsnmpmibs.so: undefined reference to 
`netsnmp_check_vb_type'

collect2: ld returned 1 exit status

make[1]: *** [snmpd] Error 1

make[1]: Leaving directory 
`/root/calient/net-snmp-5.7.1/agent'

make: *** [subdirs] Error 1

[root@psng221 net-snmp-5.7.1]#can any one help me resolving above issue. 
~sureshCC: net-snmp-coders@lists.sourceforge.net
From: fen...@gmail.com
Subject: Re: dynamic table Table creation
Date: Fri, 30 Dec 2011 16:11:12 -0500
To: skjaiswa...@hotmail.com



The agent libraries can be used from C++, so what we do is build the master 
agent using a C compiler and build our subagent with g++, and serve our MIBs 
using AgentX.
In fact, if you build libnetsnmpagent with a C compiler, you could probably 
then build your modules plus the snmp main loop and link them together. In our 
test environment we sometimes initialize all of the modules, even though it's 
linked with a C++ main loop.

  Bill


On Dec 30, 2011, at 3:17 PM, Suresh kumar <skjaiswa...@hotmail.com> wrote:





thanks Dave for quick respone 
 



Regarding
net-snmp compilation using g++ compiler we are getting similar type error one
by one previously we getting from disk_hw.c 



and
resolved using manually type casting in line 268(in disk_hw.c file)



disks =
realloc( disks, maxdisks * sizeof(
netsnmp_fsys_info*)); 



then we now
geting in dlmod.c file.



any work
around for avoiding manual type casting. .



ucd-snmp/dlmod.c:
In function 'void dlmod_load_module(dlmod*)':

ucd-snmp/dlmod.c:136: error: invalid conversion from 'void*' to 'int (*)()'

ucd-snmp/dlmod.c: In function 'void dlmod_unload_module(dlmod*)':

ucd-snmp/dlmod.c:161: error: invalid conversion from 'void*' to 'int (*)()'

ucd-snmp/dlmod.c:164: error: invalid conversion from 'void*' to 'int (*)()'



complete compilers
error are as flows



 
/bin/sh ../../libtool  --mode=compile powerpc-montavista-linux-gnu-g++  
-te500v2                                                                        
                 -I../../include -I. -I../../agent -I../../agent/mibgroup 
-I../../snmplib  -I/vo                                                          
                              bs/gxc/src/OpenSource/ace-tao/include 
-I/vobs/gxc/src/OpenSource/ace-tao/include                                      
                                                  /TAO 
-I/vobs/gxc/src/OpenSource/ace-tao/include/ace -I/vobs/gxc/src/OpenSource/a     
                                                                                
   ce-tao/include/TAO/orbsvcs  -I/vobs/gxc/src/OpenSource/ace-tao/include 
-I/vobs/g                                                                       
                 xc/src/OpenSource/ace-tao/include/TAO 
-I/vobs/gxc/src/OpenSource/ace-tao/include                                      
                                                  /ace 
-I/vobs/gxc/src/OpenSource/ace-tao/include/TAO/orbsvcs -I/vobs/gxc/src/incl     
                                                                                
   ude -I/vobs/gxc/src/include/TAO_INCLUDE -I/vobs/gxc/src/include/ACE_INCLUDE 
-I/v                                                                            
            obs/gxc/src/CommonIDL -I/vobs/gxc/src/NodeServices/CorbaSetup   
-fno-strict-alia                                                                
                        sing -Os -Ulinux -Dlinux=linux  -c -o ucd-snmp/dlmod.lo 
ucd-snmp/dlmod.c
libtool: compile:  powerpc-montavista-linux-gnu-g++ -te500v2 -I../../include 
-I.                                                                             
            -I../../agent -I../../agent/mibgroup -I../../snmplib 
-I/vobs/gxc/src/OpenSource                                                      
                                  /ace-tao/include 
-I/vobs/gxc/src/OpenSource/ace-tao/include/TAO -I/vobs/gxc/src/                 
                                                                       
OpenSource/ace-tao/include/ace 
-I/vobs/gxc/src/OpenSource/ace-tao/include/TAO/or                               
                                                         bsvcs 
-I/vobs/gxc/src/OpenSource/ace-tao/include -I/vobs/gxc/src/OpenSource/ace-      
                                                                                
  tao/include/TAO -I/vobs/gxc/src/OpenSource/ace-tao/include/ace 
-I/vobs/gxc/src/O                                                               
                         penSource/ace-tao/include/TAO/orbsvcs 
-I/vobs/gxc/src/include -I/vobs/gxc/src/in                                      
                                                  clude/TAO_INCLUDE 
-I/vobs/gxc/src/include/ACE_INCLUDE -I/vobs/gxc/src/CommonIDL                   
                                                                      
-I/vobs/gxc/src/NodeServices/CorbaSetup -fno-strict-aliasing -Os -Ulinux 
-Dlinux                                                                         
               =linux -c ucd-snmp/dlmod.c  -fPIC -DPIC -o ucd-snmp/.libs/dlmod.o
ucd-snmp/dlmod.c: In function 'void dlmod_load_module(dlmod*)':
ucd-snmp/dlmod.c:136: error: invalid conversion from 'void*' to 'int (*)()'
ucd-snmp/dlmod.c: In function 'void dlmod_unload_module(dlmod*)':
ucd-snmp/dlmod.c:161: error: invalid conversion from 'void*' to 'int (*)()'
ucd-snmp/dlmod.c:164: error: invalid conversion from 'void*' to 'int (*)()'
make[3]: *** [ucd-snmp/dlmod.lo] Error 1
make[3]: Leaving directory `/vobs/thirdparty/net-snmp-5.7.1/agent/mibgroup'
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/vobs/thirdparty/net-snmp-5.7.1/agent'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/vobs/thirdparty/net-snmp-5.7.1'
make: *** [build] Error 2


 
> Date: Fri, 30 Dec 2011 19:11:36 +0000
> Subject: Re: dynamic table Table creation
> From: d.t.shi...@liverpool.ac.uk
> To: skjaiswa...@hotmail.com
> CC: net-snmp-coders@lists.sourceforge.net
> 
> On 30 December 2011 18:09, Suresh kumar <skjaiswa...@hotmail.com> wrote:
> > You haven't said which mib2c framework you are using for your table,
> >> but a number of them take the option
> >>
> >> mib2c -Scache=1 .....
> >>
> >> which will include the basic cache handling code.
> >
> >
> > 1. We are generating table code templates by executing the following
> > command:
> >   mib2c -c mib2c.create-dataset.conf calientChassis.
> 
> OK - that doesn't recognise the -Scache flag, as this whole approach
> is essentially one big cache.   It's really designed for a pure-SNMP
> table - i.e. one where all updates are done via SNMP SET requests.
> It's not really suited to integrating with an external data source.
> 
> >   Will it not be possible to handle updates efficiently using dataset APIs?
> 
> I haven't done any benchmarking, but I wouldn't expect it to be as efficient
> as some of the others - most notably the table_tdata helper.
> Remember that the dataset helper uses a generic mechanism for handling
> the individual columns, since it needs to work with *any* MIB module
> (with no code changes).
>    The other helpers, such as table_tdata, will generate a dedicated data
> structure to represent a row of this particular table, so can go straight to
> the relevant column value.
> 
> But I haven't done any timings - your mileage may vary.
> 
> 
> >    We do not want to create files as required for implementation using the
> > cache option.
> >    Are these files cleaned up on agent shutdown?.
> 
> The cache mechanism doesn't use any files.
> It stores a local copy of the table in memory (updating it as required).
> Obviously, this memory is released when the agent shuts down.
> 
> 
> 
> > 2 . We also trying integrate net-snmp 5.7 code with our CORBA stub.
> > we made our C++ interfaces.
> >        and want acess this interfce directely in net-snmp extended MIB agent
> > code for geting and seting functiinality.
> >       hence   can we compile net-snmp code using g++ compile for acessing
> > c++ code in directely in our extended
> >                  calient agent code.?
> 
> It should be possible to compile the Net-SNMP code using g++, yes.
> Certainly all of the files are wrapped in "extern C" blocks, and we have
> had reports of this working in the past.
>    But the suite is primarily aimed at straight C applications, so there
> may have been some code changes that break a C++ compilation.
> Give it a go, and let us know how you get on.
> 
> 
> 
> Dave
                                          
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! 
http://p.sf.net/sfu/Citrix-VDIinabox_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
                                          
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to