[haiku-development] Re: Help regarding GSoC idea : Tracker add-on for a version control system

  • From: Hrishi Hiraskar <hrishihiraskar@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 26 Mar 2018 18:22:11 +0000

I finaly got  the symbol to be found...

I used  extern "C" in addonn code itself.

The reason for it not recognizing extern "C" earlier was, for compiling the
addon, I needed to install haiku_devel, which upgraded the system. This
means the changed header file TrackerAddOn.h no longer contains `extern "C"
void populate_menu`. Due to this, its name was C++ mangled.

But now that I can call `populate_menu (entry_ref dir_ref, BMessage *msg,
BMenuItem* item)`,  where I'm passing the BMenuItem of the add on item
created at
https://github.com/Hrily/haiku/blob/63ede39cc8b8149b906969666c0f1bc7ad80193c/src/kits/tracker/ContainerWindow.cpp#L235

I can neither access `item->Submenu()` nor `item->Menu()`. Both turned out
to be null.

Any idea on how I can access the add on menu?

On Mon, Mar 26, 2018 at 1:25 PM Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
wrote:

26 mars 2018 09:29 "Hrishi Hiraskar" <hrishihiraskar@xxxxxxxxx> a écrit:

So any idea on how to make it's name to just `populate_menu`.

Just declaring it as extern "C" should work. So it would seem your add-on
was not compiled using the modified .h file, or the prototype does not
match.

You can declare it as extern "C" directly in your add-on sourcecode
however, it will save you having to change system header files for
experimenting. Check with readelf until the add-on is properly built, then
try again.

--
Adrien.


Other related posts: