On Sun, Apr 15, 2012 at 9:53 AM, klaas.holwerda <n...@klaasholwerda.nl> wrote: >>> [ 19%] Building CXX object >>> modules/luamodule/CMakeFiles/wxLuaModule.dir/__/wxbind/src/wxcore_gdi.cpp.o >>> /home/klaas/soft/wxlua/trunk/wxLua/modules/wxbind/src/wxcore_gdi.cpp: In >>> function ‘int >>> wxLua_wxIconBundle_AddIcon(lua_State*)’: >>> /home/klaas/soft/wxlua/trunk/wxLua/modules/wxbind/src/wxcore_gdi.cpp:7356:29: >>> warning: ‘void >>> wxIconBundle::AddIcon(const wxString&, long int)’ is deprecated (declared >>> at >>> /usr/local/include/wx-2.9/wx/iconbndl.h:91) [-Wdeprecated-declarations] >>> /home/klaas/soft/wxlua/trunk/wxLua/modules/wxbind/src/wxcore_gdi.cpp: In >>> function ‘int >>> wxLua_wxIconBundle_GetIcon1(lua_State*)’: >>> /home/klaas/soft/wxlua/trunk/wxLua/modules/wxbind/src/wxcore_gdi.cpp:7374:63: >>> error: taking address >>> of temporary [-fpermissive] >> This line? >> const wxIcon* returns = (const wxIcon*)&self->GetIcon(size); >> >> I'm not sure how to convince GCC that this is a not a temporary >> variable since it isn't. > Why not?? A wxIcon is returned from GetIcon(size), and that is a temporary i > think. > But i am not good at such thinks.
The GetIcon() function returns a reference to an element of an array member of the wxIconBundle. This means that the reference is valid so long as the array element exists which is reasonably non-temporary. I see now that internally, that function actually uses a wxIcon* pointer to that element then dereferences it to return it with a comment saying that it is a workaround for the Borland compiler. This is probably why GCC is getting confused. >> Could you try this: >> const wxIcon* returns = reinterpret_cast<const >> wxIcon*>(&self->GetIcon(size)); > Did not help. > But the next does ( it stores/copies the return wxIcon first ): > > static wxIcon icon = self->GetIcon(size); > const wxIcon* returns = (const wxIcon*) &icon; If this function is called twice, the first call's icon gets changed by the second call. > or: > wxIcon icon = self->GetIcon(size); > const wxIcon* returns = (const wxIcon*) &icon; This is definitely no good as the "icon" variable is definitely temporary. >> Can you compile the wxWidgets media control sample without error? > If you mean the MediaPlayer example, yes, and it works. I do not see another > example, so i think > that is the only one. Yes, that one. > With all the advice, i now get until here (see end this mail). The library > -lgstinterfaces-0.10 is > missing to link too? If i add it by hand as -lgstinterfaces-0.10 down here, > on the commandline, it > links. > In aps/CMakeLists change this, also works: > > LINK_LIBRARIES > #wxLuaBindLib > ${wxLuaBind_ALL_LIBS} > wxLuaSocketLib > wxLuaDebugLib > wxLuaLib > LuaLib > gstinterfaces-0.10 > ${wxWidgets_LIBRARIES} > > With that i can compile completely! :-) That's good, for now. wxLua doesn't use anything in gstreamer besides what wxWidgets uses, so I'm guessing that Ubuntu broke up the gstreamer library (or somehow compiled it differently) so that wxWidgets itself should really link to gstinterfaces as well. Maybe the sample doesn't call the function(s) that use anything from it so that why you don't get the linker error for gstinterfaces. I'll see about installing the newest Ubuntu into a virtual machine. > But -Wno-deprecated did not make much a difference for all the warnings?? I'll look into this. Regards, John ------------------------------------------------------------------------------ Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free. http://p.sf.net/sfu/Boundary-dev2dev _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users