[sldev] Trying to create a menu entry/dialog

Alex Ciarlillo ac251404 at ohio.edu
Sat Oct 6 18:24:46 PDT 2007


I have programmed a dialog for the viewer and am trying to get it to 
open from a menu. I followed the 2 tutorials on the wiki:

https://wiki.secondlife.com/wiki/Adding_a_dialog
https://wiki.secondlife.com/wiki/Adding_a_menu_item

I followed the first tut to the letter except for changing the names on 
the commit/button. For the second tutorial I followed pretty much 
everything except the last part where it has you add a line to the 
intialize_menu_actions() function. This appeared deprecated to me so I 
added the following to the initialize_menus() function:

addMenu(new LLToolsSearch(), "Tools.Search");

The name of the class for the menus is LLToolSearch and it calls the 
show method of my dialog which is named LLFloaterSearch. When I compiled 
however I keep getting the following error:

In function 'LLToolsSearch::handleEvent(LLPointer<LLEvent>, LLSD const&)':
    undefined reference to 'LLFloaterSearch::show(void*)'

I have checked and triple checked all my includes and they seem to be in 
order but I will list them -
    llviewermenu.cpp:  "llfloatersearch.h"
    llfloatersearch.h:     "llfloater.h"
    llfloatersearch.cpp: "llviewerprecompiledheaders.h", 
"llfloatersearch.h", "llvieweruictrlfactory.h" 


I am developing on Ubuntu 7.04 using scons. I have specified a build 
directory and when I looked in the newview folder of the partially 
completed build I noticed it had llfloatersearch.h but no .cpp or .o 
file. I have tried building from scratch as well and it does not work.

This is the first time I have added my own source files to the viewer 
(llfloatersearch.h and .cpp) and am thinking I must be doing something 
wrong either in the compile command im using for SCons or in the 
linking. It is also possible that the wiki is dated enough that the 
instructions to not work.

So does anyone have an idea of what the problem could be?

Thanks,
Alex C.


More information about the SLDev mailing list