Page 1 of 1

Bug Report: wxVLC playlist.cpp does not compile with STL

Posted: 10 Jan 2006 05:04
by Tinyn
I'm sorry I don't have the error message any more, but I can tell you how to recreate it. (I'm using gentoo, but this problem has to do with wx calls so its probably crossplatform. This applies to VLC 0.8.2 and up.)


In wxWidgets setup.h there is an option for USE_STL. This defaults to 0, but if you set it to 1, the wxList, wxArray, wxString, etc classes become wrappers around the STL.

In playlist.cpp there (line 1200ish, or 1600ish) there is a line to declare an instance of wxMenuItemList::Node. With STL enabled the wxList class (and thus wxMenuItemList) no longer has a Node member. This causes a compiler error.

Posted: 10 Jan 2006 23:50
by dionoea
Would you be able to come up with a patch to fix that ? (this would make it easier for us to fix it ...)

Posted: 02 Jun 2007 21:05
by _wedge_
hi

i know this thread is old..., but today i got the same error, not only in playlist.cpp also in menus.cpp [static void RecursiveDestroy( wxMenu *menu )].
I rewrote the function in the menus.cpp, also the playlist.cpp function wxMenu * Playlist::ViewMenu(). I hope this is useful...

menus.cpp:

Code: Select all

static void RecursiveDestroy( wxMenu *menu ) { for(signed short i = (signed short) menu->GetMenuItemCount(); i >= 0; i--) { wxMenuItem *item = menu->FindItemByPosition(i); if(item != NULL) { wxMenu *submenu = item->GetSubMenu(); if(submenu) RecursiveDestroy(submenu); menu->Delete(item); } } }
playlist.cpp

Code: Select all

wxMenu * Playlist::ViewMenu() { if( !p_view_menu ) { p_view_menu = new wxMenu; } else /*rewritten part*/ { for(signed short i = (signed short) p_view_menu->GetMenuItemCount(); i >= 0; i--) { wxMenuItem *item = p_view_menu->FindItemByPosition(i); if(item != NULL) p_view_menu->Delete(item); } } /*end of rewritten part*/ /* FIXME : have a list of "should have" views */ p_view_menu->Append( FirstView_Event + VIEW_CATEGORY, wxU(_("Normal") ) ); p_view_menu->Append( FirstView_Event + VIEW_S_AUTHOR, wxU(_("Sorted by Artist") ) ); p_view_menu->Append( FirstView_Event + VIEW_S_ALBUM, wxU(_("Sorted by Album") ) ); return p_view_menu; }
It worked fine for me.

david