|
From: Dave T. <duk...@gm...> - 2011-09-17 17:33:47
|
On 16 September 2011 22:40, D.V. <dav...@gm...> wrote: > Bonsoir List, > > I'm trying to follow the instructions from > http://www.haskell.org/haskellwiki/WxHaskell/Development/Environment > however it's not working. > > - cabal-dev add-source wxdirect works fine > - cabal-dev add-source wxcore has an error > - cabal-dev add-source wx works fine > > wxcore error: > [...] > Configuring wxcore-0.13.1... > setup: Missing dependencies on foreign libraries: > * Missing C libraries: wx_baseu-2.8, wx_baseu_net-2.8, wx_baseu_xml-2.8, > wx_gtk2u_core-2.8, wx_gtk2u_adv-2.8, wx_gtk2u_html-2.8, wx_gtk2u_qa-2.8, > wx_gtk2u_xrc-2.8, wx_gtk2u_aui-2.8, wx_gtk2u_richtext-2.8 > This problem can usually be solved by installing the system packages that > provide these libraries (you may need the "-dev" versions). If the > libraries > are already installed but in a non-standard location then you can use the > flags --extra-include-dirs= and --extra-lib-dirs= to specify where they > are. > Building source dist for wxcore-0.13.1... > Preprocessing library wxcore-0.13.1... > Source tarball created: dist/wxcore-0.13.1.tar.gz > > I'm on kubuntu 11.04. > I have a fresh ghc7.0.1 install. > cabal install wx worked fine; I am able to compile and run wxHaskell > programs. > > running with verbose=3 tells me a bunch of > /usr/bin/gcc returned ExitFailure 1 with error message: > /usr/bin/ld: cannot find -lwxmsw28ud_media > /usr/bin/ld: cannot find -lwxmsw28ud_richtext > /usr/bin/ld: cannot find -lwxmsw28ud_aui > /usr/bin/ld: cannot find -lwxmsw28ud_xrc > Thanks for posting so much information, this is very similar to a problem I had with the latest from code.haskell.org. You'll note that those missing libraries contain "msw", i.e. "Microsoft Windows", which us Linux users certainly shouldn't be trying to link against. collect2: ld returned 1 exit status > > a search on google brings a few pages, however I still can't figure > out how to make it work. > > Here's what libraries I have that contain 'wx', I've no idea how to > get the missing ones. > > $ find /usr -name '*wx*so' > /usr/lib/libwxsvg.so > /usr/lib/libwx_gtk2u_ogl-2.8.so > /usr/lib/libwx_gtk2u_xrc-2.8.so > /usr/lib/libwx_gtk2u_richtext-2.8.so > /usr/lib/libwx_gtk2u_gizmos-2.8.so > /usr/lib/libwx_gtk2u_fl-2.8.so > /usr/lib/libwx_gtk2u_html-2.8.so > /usr/lib/libwx_baseu_net-2.8.so > /usr/lib/libwx_gtk2u_aui-2.8.so > /usr/lib/libwx_gtk2u_stc-2.8.so > /usr/lib/libwx_baseu_xml-2.8.so > /usr/lib/libwx_gtk2u_core-2.8.so > /usr/lib/libwx_gtk2u_gizmos_xrc-2.8.so > /usr/lib/libwx_gtk2u_qa-2.8.so > /usr/lib/libwx_gtk2u_adv-2.8.so > /usr/lib/libwx_baseu-2.8.so > /usr/lib/libwx_gtk2u_svg-2.8.so > /usr/lib/libwx_gtk2u_gl-2.8.so > /usr/lib/libwx_gtk2u_plot-2.8.so > > Please help ! > > David. > I see from this you're on wx 2.8 for GTK, and that's okay, we just need to remove those non-Linux libraries, and I'm afraid that involves some hacking (I'm working on a patch to clean this up, I need to get it to the list): You'll need to edit wxcore/Setup.hs thus: On or around line 51 you'll see: > let extra_wx_libs = if ver == "9" [BUNCH OF LIBRARY INCLUDES] Now I use wx 2.9 for GTK, and I've replaced the include list with these: > [ "-lwx_gtk2u_xrc-2.9", "-lwx_gtk2u_stc-2.9", "-lwx_gtk2u_aui-2.9" > , "-lwx_gtk2u_ribbon-2.9", "-lwx_gtk2u_propgrid-2.9", "-lwx_gtk2u_richtext-2.9" > , "-lwx_gtk2u_gl-2.9", "-lstdc++"] Hopefully you can adjust this for your needs, and it would be great if you could send your list back so I can include it in my patch. For the curious: Wondering how the library can still compile with some includes missing? (I believe, perhaps someone can confirm...) If you inspect some of the .cpps under wxcore/src/cpp/ you'll find they do a bunch of ifdefs (for example ifdef wxUSE_MEDIACTRL). Where do these defines come from? Well in Setup.hs you'll find this: > (readProcess "wx-config" ["--libs", "--cppflags"] "") And that "cppflags" flag will print out (or in our case, on Linux, not print out) things like (wxUSE_MEDIACTRL), these are passed to "ccOptions" (from Distribution.InstalledPackageInfo), and the build system then passes these to the CPP linker. Hope this helps, Dave > > > ------------------------------------------------------------------------------ > BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA > http://p.sf.net/sfu/rim-devcon-copy2 > _______________________________________________ > wxhaskell-devel mailing list > wxh...@li... > https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel > |