On Sat, Apr 14, 2012 at 6:20 AM, klaas.holwerda <n...@klaasholwerda.nl> wrote:

> The problem came back, both vars are empty:
>
> if ((CMAKE_SIZEOF_VOID_P MATCHES 4) OR (CMAKE_CL_64 MATCHES 0))
>     set(IS_32_BIT TRUE)
>     set(IS_64_BIT FALSE)
> elseif((CMAKE_SIZEOF_VOID_P MATCHES 8) OR (CMAKE_CL_64 MATCHES 1))
>     set(IS_32_BIT FALSE)
>     set(IS_64_BIT TRUE)
> else()
>     MESSAGE(WARNING "Oops, unable to determine if using 32 or 64 bit 
> compilation.")
>     MESSAGE(WARNING "CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P} CMAKE_CL_64 
> ${CMAKE_CL_64}" )
> endif()

Sounds like you may have the problem with CMake discussed here.

http://www.cmake.org/pipermail/cmake/2011-January/042058.html

Not sure how to handle that, maybe I should simply cache IS_XX_BIT so
it stays the same between CMake runs.

> [ 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.

Could you try this:
const wxIcon* returns = reinterpret_cast<const wxIcon*>(&self->GetIcon(size));

> No id added this again ( -Wdeprecated-declarations does not seem to help, but 
> i do get an enormous
> amount of warning about it):

That's fine, wxWidgets declares a lot of functions deprecated, but
wxLua supports multiple versions. It's unfortunately something we have
to live with, unless I ignore them all with -Wno-deprecated to silence
them, which I probably will.

>     if (IS_64_BIT)
>         add_definitions( -fPIC )
>         add_definitions(-Wdeprecated-declarations )
>         add_definitions(-fpermissive)
>         #set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -fPIC)
>     endif()
>
> I am now here:
>
> Linking CXX shared library libwx.so
> /usr/bin/ld: /usr/local/lib/libwx_gtk2u_stc-2.9.a(stclib_stc.o): relocation 
> R_X86_64_32 against
> `wxStyledTextCtrl::sm_eventTable' can not be used when making a shared 
> object; recompile with -fPIC
> /usr/local/lib/libwx_gtk2u_stc-2.9.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make[2]: *** [modules/luamodule/libwx.so] Error 1
> make[1]: *** [modules/luamodule/CMakeFiles/wxLuaModule.dir/all] Error 2
> make: *** [all] Error 2
>
> No idea what this is all about. I believe -fPIC was used.

-fPIC is definitely used for wxLua in 64-bit for everything, is it for
wxWidgets when building staticly? You can probably check by calling
wx-config --cxxflags

This is what's going on. You build wxWidgets statically, and I bet
they don't use -fPIC when building it. wxLua tries to create a shared
libwx.so and links to the static wx libs and you get the -fPIC errors.

Maybe rebuild wxWidgets with

make CXXFLAGS=-fPIC CFLAGS=-fPIC (or do this through configure)

> And libwx.so is that a wxLua lib?

Yes, it is the Lua module that from Lua you call require("wx") to
load, but I have not finished testing it.

> Now i found BUILD_SHARED_LIBS as one of the Cmake options.
>
> Linking CXX shared library libwx.so
> cd /home/klaas/soft/buildwxluadeb29/modules/luamodule && /usr/bin/cmake -E 
> cmake_link_script
> CMakeFiles/wxLuaModule.dir/link.txt --verbose=1
> /usr/bin/c++  -fPIC  -pthread -g   -shared -Wl,-soname,libwx.so -o libwx.so
> CMakeFiles/wxLuaModule.dir/src/luamodule.cpp.o
...
> CMakeFiles/wxLuaModule.dir/__/wxlua/src/wxlstate.cpp.o
> CMakeFiles/wxLuaModule.dir/__/wxlua/src/wxlua_bind.cpp.o -L/usr/local/lib 
> ../lua/libLuaLibShared.so
> -L/usr/local/lib -pthread /usr/local/lib/libwx_gtk2u_stc-2.9.a 
> /usr/local/lib/libwx_gtk2u_xrc-2.9.a
> /usr/local/lib/libwx_baseu_net-2.9.a /usr/local/lib/libwx_gtk2u_media-2.9.a
> /usr/local/lib/libwx_gtk2u_propgrid-2.9.a 
> /usr/local/lib/libwx_gtk2u_richtext-2.9.a
> /usr/local/lib/libwx_gtk2u_aui-2.9.a /usr/local/lib/libwx_gtk2u_html-2.9.a
> /usr/local/lib/libwx_gtk2u_adv-2.9.a /usr/local/lib/libwx_gtk2u_core-2.9.a
> /usr/local/lib/libwx_baseu_xml-2.9.a /usr/local/lib/libwx_baseu-2.9.a 
> -lwxscintilla-2.9 -pthread
> -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 
> -lpangocairo-1.0 -lgdk_pixbuf-2.0
> -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 
> -lgthread-2.0 -lrt
> -lglib-2.0 -lX11 -lSM -lpng -ljpeg -lexpat -lwxregexu-2.9 -lwxtiff-2.9 -lz 
> -ldl -lm
> -Wl,-rpath,/usr/local/lib:/home/klaas/soft/buildwxluadeb29/modules/lua:
> /usr/bin/ld: /usr/local/lib/libwx_gtk2u_stc-2.9.a(stclib_stc.o): relocation 
> R_X86_64_32 against
> `wxStyledTextCtrl::sm_eventTable' can not be used when making a shared 
> object; recompile with -fPIC
> /usr/local/lib/libwx_gtk2u_stc-2.9.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make[2]: *** [modules/luamodule/libwx.so] Error 1
> make[2]: Leaving directory `/home/klaas/soft/buildwxluadeb29'
> make[1]: *** [modules/luamodule/CMakeFiles/wxLuaModule.dir/all] Error 2
> make[1]: Leaving directory `/home/klaas/soft/buildwxluadeb29'
> make: *** [all] Error 2
>
> Still see -shared in there :-(

Yes, this is intentional. The library libwx.so must always be shared
so it can be dynamically loaded from Lua.

> /usr/local/lib/libwx_gtk2u_media-2.9.a(medialib_unix_mediactrl.o): In 
> function `gst_message_unref':
> /usr/include/gstreamer-0.10/gst/gstmessage.h:347: undefined reference to 
> `gst_mini_object_unref'
> /usr/local/lib/libwx_gtk2u_media-2.9.a(medialib_unix_mediactrl.o): In function
> `gtk_window_expose_callback':
> /home/klaas/soft/buildwx29statdeb/../wxWidgets-2.9.3/src/unix/mediactrl.cpp:280:
>  undefined reference
> to `gst_x_overlay_expose'
> /usr/local/lib/libwx_gtk2u_media-2.9.a(medialib_unix_mediactrl.o): In function
> `gtk_window_realize_callback':

Can you compile the wxWidgets media control sample without error?

Regards,
    John

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to