Personal tools

WxHaskell/Troubleshooting

From HaskellWiki

< WxHaskell(Difference between revisions)
Jump to: navigation, search
m
(Added category wxHaskell)
 
(2 intermediate revisions by one user not shown)
Line 45: Line 45:
 
* sample applications just sit there doing nothing (MacOS X)
 
* sample applications just sit there doing nothing (MacOS X)
 
** <b>Solution</b>: <code>macosx-app</code> the application
 
** <b>Solution</b>: <code>macosx-app</code> the application
  +
** <b>Workaround</b> (2009-04-01) If the above solution still does not work (wxWidgets 2.8; Leopard), try running the version of the executable foo.app/Contents/MacOS/foo (generated by macosx-app) or <code>open foo.app</code>. I haven't figured out how to run it otherwise, and have just resigned to copying the app bundle somewhere and putting it in my path :-(
 
* sample applications segfault!
 
* sample applications segfault!
 
** <b>Solution</b>: upgrade wxhaskell to the darcs version. It supports wxWidgets 2.8 as of 2008-04-25
 
** <b>Solution</b>: upgrade wxhaskell to the darcs version. It supports wxWidgets 2.8 as of 2008-04-25
Line 86: Line 87:
 
**<code>ld: /usr/lib/crt1.o illegal reference to symbol: __objcInit defined in indirectly referenced dynamic library /usr/lib/libobjc.A.dylib</code>
 
**<code>ld: /usr/lib/crt1.o illegal reference to symbol: __objcInit defined in indirectly referenced dynamic library /usr/lib/libobjc.A.dylib</code>
 
**<b>Solution:</b>Adding -framework AppKit to the compiler switches for your Haskell program seems to help
 
**<b>Solution:</b>Adding -framework AppKit to the compiler switches for your Haskell program seems to help
  +
  +
  +
[[Category:wxHaskell]]

Latest revision as of 20:52, 15 January 2012

Contents

[edit] 1 Compilation issues

  • Trouble building wxWidgets (MacOS X Tiger)
    • ld: /System/Library/Frameworks/WebKit.framework/WebKit load command 20 unknown cmd field
    • /usr/bin/libtool: internal link edit command failed
    • make: *** [lib/libwx_macu_core-2.6.0.4.0.dylib]
    • Likely Solution: Upgrade to XCode >= 2.5
  • Can't build wxWidgets 2.6 (MacOS X Leopard)
    • Solution: upgrade to wxWidgets 2.8 and the darcs version of wxhaskell (2008-04-25)
  • Configure Succeeded (and nothing more)
    • Solution: Upgrade to the latest version of Cabal and cabal-install (darcs)
  • error build wxcore
    • /usr/libexec/gcc/i686-apple-darwin8/4.0.1/libtool: can't locate file for: -lwx_macu_media-2.6
    • /usr/libexec/gcc/i686-apple-darwin8/4.0.1/libtool: file: -lwx_macu_media-2.6 is not an object file (not allowed in a library)
    • Solution: try --enable-mediactrl in the wxWidgets configure
  • Too many levels of symbolic links (Linux)
    • UNKNOWN!
  • cabal install wx fails
    • Try: cabal install wx --configure-opt="--user --enable-split-objs --hcprof"
    • One issue is that wxcore currently (2009-02-14) uses the make build method instead of the simple one, and that is a bit fragile
    • See WxHaskell/Building for more details

[edit] 2 App-compilation issues

  • Could not find module `Graphics.UI.WX':
    • Solution Make sure you build and install the wx package too (wxhaskell comes in two parts, wxcore, which is what you get if you do ./configure; make; make install; and wx, which you can install by cd'ing into its directory and doing the standard Cabal stuff)
  • sample application dies with something like (Linux)
    • /usr/lib/libwxc-gtk2.6.3-0.10.2.so: undefined reference to `wxGLCanvas::SwapBuffers()'
    • /usr/lib/libwxc-gtk2.6.3-0.10.2.so: undefined reference to `wxGLCanvas::SetCurrent()'
    • /usr/lib/libwxc-gtk2.6.3-0.10.2.so: undefined reference to `wxGLCanvas::wxGLCanvas(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette const&)'
    • /usr/lib/libwxc-gtk2.6.3-0.10.2.so: undefined reference to `wxGLCanvas::wxGLCanvas(wxWindow*, wxGLCanvas const*, int, wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette const&)'
    • /usr/lib/libwxc-gtk2.6.3-0.10.2.so: undefined reference to `wxGLCanvas::SetColour(wchar_t const*)'
    • collect2: ld returned 1 exit status
    • Solution Update to the latest wxhaskell (the darcs version on 2008-02-20) (before, --with-opengl was required, now it is not)
  • Unknown...
    • /usr/lib/libwxc-gtk2.6.3-0.10.1.so: undefined reference to `wxWindowBase::Hide()'
    • ...
    • `wxLog::AddTraceMask(wxString const&)' /usr/lib/libwxc-gtk2.6.3-0.10.1.so: undefined reference to `wxHtmlHelpController::GetFrame()'
    • /usr/lib/libwxc-gtk2.6.3-0.10.1.so: undefined reference to `wxPrintData::SetQuality(int)'
    • collect2: ld returned 1 exit status

[edit] 3 Runtime issues

  • sample applications just sit there doing nothing (MacOS X)
    • Solution: macosx-app the application
    • Workaround (2009-04-01) If the above solution still does not work (wxWidgets 2.8; Leopard), try running the version of the executable foo.app/Contents/MacOS/foo (generated by macosx-app) or open foo.app. I haven't figured out how to run it otherwise, and have just resigned to copying the app bundle somewhere and putting it in my path :-(
  • sample applications segfault!
    • Solution: upgrade wxhaskell to the darcs version. It supports wxWidgets 2.8 as of 2008-04-25
  • wxhaskell builds fine, but sample applications do this:
    • dyld: Symbol not found: __ZN8wxThread11TestDestroyEv
    • Referenced from: /usr/local/wxhaskell/lib/libwxc-mac2.8.7-0.10.1.dylib
    • Expected in: flat namespace
    • trace trap ./BouncingBalls
    • Solution: try --enable-shared in wxWidgets config
  • Certain buttons and widgets (particularly, those inside of "boxed" environments) are not active (still a problem, 2008-02-20)
    • Solution: upgrade to latest version (0.10.3 as of 2008-03-23). It was a wxHaskell bug that is now fixed.
  • I only see the first letter of every word
    • Solution build wxWidgets with --enable-unicode. (We now use wchar* to store strings; but if wxWidgets is compiled without unicode, it thinks it's using char* and that null bytes are string terminators)
  • Loading package wxcore-0.10.3 ... : can't load .so/.DLL for: wxc-msw2.6.4-0.10.3 (addDLL: unknown error) (GHCi)
    • Unknown!: but you must check that compiled sample application works or not. If sample application doesn't work, please report error message to wxhaskell-users mailing-list (Don't forgot to report error number when reporting error message).
  • sample applications terminate with following error message (Windows). The applicattion failed to initialize properly (0xc0150002). Click OK to terminate the application.
  • When I run a GUI for the second time in GHCi, it crashes.
    • No Solution: This is a known issue which is unlikely to be fixed as it is a consequence of design decisions in the underlying wxWidgets library (use of C++ static destructors). The problem is that after the main loop terminates in GHCi, wxWidgets library has not been finalized.
    • The last known working version of wxWidgets to support re-running main was wxWidgets 2.4.2. wxHaskell 0.9.4-1 supports this version, but may require a small amount of work to compile with recent versions of GHC.
  • (Linux) When running programs you get "...initialization assertion failed, use IA__g_type_init()...", then you need to use a version from the Darcs repository (newer than 15th Jan 2009). This patch solves the problem.

[edit] 4 Old issues

WARNING: likely to be obsolete

  • Problems compiling wxHaskell (something like the below) (MacOS X)
    • /tmp/ghc29861.s:4379: Unknown pseudo-op:
    • .subsections_via_symbol
    • Solution: Make sure you have at least Xcode 1.5 (gcc 3.3 build 1671). Xcode 1.1 (gcc build 1495) is not enough
  • More linker trouble (MacOS X):
    • ld: out/wxc/master.o undefined symbol 36311 (__ZdaPv) can't be a weak definition
    • /usr/bin/libtool: internal link edit command failed
    • make: *** [out/wxc/libwxc-mac2.6.2-0.9.4.dylib] Error 1
    • Solution?: Add the gcc 3.3 version of libstdc++ to your dylib: http://page.freett.com/shelarcy/log/2006/diary_02.html
    • Solution?If you use gcc 4, try to add the following linker flags "-lSystemStubs -shared-libgcc -lstdc++-static". (libstdc++-static.a is part of XCode 2.3)
  • [OBSOLETE?] If you get linker errors like it not being able to find _TextziParserCombinatorsziParsecziChar_alphaNum_closure
    • Solution:Try editing config/config.mk and setting HC=ghc -lHSparsec. This is likely not a mac-specific problem but related to the use of GHC 6.2 over 6.0.1. (not sure if this is still valid)
  • [OBSOLETE?] When compiling your Haskell program (MacOS X):
    • ld: /usr/lib/crt1.o illegal reference to symbol: __objcInit defined in indirectly referenced dynamic library /usr/lib/libobjc.A.dylib
    • Solution:Adding -framework AppKit to the compiler switches for your Haskell program seems to help