- I'm new to developing in Nagios and am having trouble adding the helloworld module that comes in the  nagios-3.1.0/module/ directory. When using the suggested command of "gcc -shared -o helloworld.o helloworld.c" or the given module/Makefile or via nagios's overall "make all" (when removing the -undefined supress gcc option) I receive the following error:<div>
<br class="webkit-block-placeholder"></div><div><div><div>--------------------------------------------</div></div></div><div><div>ERROR BELOW:</div></div><div><div>--------------------------------------------</div></div><div>
<div>[module]$ gcc -shared -o helloworld.o helloworld.c</div><div>Undefined symbols:</div><div>  "_main", referenced from:</div><div>      start in crt1.10.5.o</div><div>  "_schedule_new_event", referenced from:</div>
<div>      _nebmodule_init in cctSjeOe.o</div><div>  "_neb_deregister_callback", referenced from:</div><div>      _nebmodule_deinit in cctSjeOe.o</div><div>  "_write_to_all_logs", referenced from:</div>
<div>      _nebmodule_init in cctSjeOe.o</div><div>      _nebmodule_init in cctSjeOe.o</div><div>      _nebmodule_deinit in cctSjeOe.o</div><div>      _helloworld_reminder_message in cctSjeOe.o</div><div>      _helloworld_handle_data in cctSjeOe.o</div>
<div>  "_neb_set_module_info", referenced from:</div><div>      _nebmodule_init in cctSjeOe.o</div><div>      _nebmodule_init in cctSjeOe.o</div><div>      _nebmodule_init in cctSjeOe.o</div><div>      _nebmodule_init in cctSjeOe.o</div>
<div>      _nebmodule_init in cctSjeOe.o</div><div>      _nebmodule_init in cctSjeOe.o</div><div>  "_neb_register_callback", referenced from:</div><div>      _nebmodule_init in cctSjeOe.o</div><div>ld: symbol(s) not found</div>
<div>collect2: ld returned 1 exit status</div><div>[module]$</div><div><div>--------------------------------------------</div><div><br class="webkit-block-placeholder"></div></div><div>- The neb_set_module_info function does exist, shown below:<br>
</div><div><div>[nagios-3.1.0]$ grep -Hnr "neb_set_module_info" *cd ..</div><div>Binary file base/nagios matches</div><div>Binary file base/nagios.dSYM/Contents/Resources/DWARF/nagios matches</div><div>base/nebmods.c:391:int neb_set_module_info(void *handle, int type, char *data){</div>
<div>Binary file base/nebmods.o matches</div><div>include/nebmodules.h:96:int neb_set_module_info(void *,int,char *);</div><div>module/helloworld.c:61: neb_set_module_info(helloworld_module_handle,NEBMODULE_MODINFO_TITLE,"helloworld");</div>
<div>[nagios-3.1.0]$</div><div><br class="webkit-block-placeholder"></div><div><div><div><div>--------------------------------------------</div></div></div><div></div></div><div>Makefile BELOW</div><div><div><div><div>--------------------------------------------</div>
<div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial"># Makefile for NEB examples</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">#</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial"># Last Modified: 12-14-2007</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial"># Source code directories</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">SRC_INCLUDE=../include</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">CC=gcc</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">MOD_CFLAGS= -fno-common</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">CFLAGS=-g -O2 -I/sw/include/ -DHAVE_CONFIG_H</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">#MOD_LDFLAGS=-bundle -flat_namespace -undefined suppress</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">MOD_LDFLAGS=-bundle -flat_namespace</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">LDFLAGS= -L/sw/lib/</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">LIBS=</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">prefix=/usr/local/nagios</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">exec_prefix=${prefix}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">BINDIR=${exec_prefix}/bin</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">INSTALL=/usr/bin/install -c</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">INSTALL_OPTS=-o nagios -g nagios</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">COMMAND_OPTS=-o nagios -g nagiocmd</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">STRIP=/usr/bin/strip</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">CP=@CP@</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">all:    helloworld.o</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">helloworld.o: helloworld.c</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial">        $(CC) $(MOD_CFLAGS) $(CFLAGS) -o helloworld.o helloworld.c $(MOD_LDFLAGS) $(LDFLAGS) $(LIBS)</p></div></div></div><div></div></div><div><div><div><div>
<div>--------------------------------------------</div><div><br class="webkit-block-placeholder"></div></div></div><div></div></div></div><div>- Finally, I copy helloworld.o from where nagios runs and enable the even_broker in nagios.cfg"</div>
<div>broker_module=/usr/local/nagios/bin/helloworld.o<br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>Why would gcc not find/compile the needed files? I'd appreciate any pointers you would give in how to successfully compile the sample module.</div>
<div><br class="webkit-block-placeholder"></div><div>thank you,</div><div>atoosaah</div><div><br class="webkit-block-placeholder"></div></div></div>