Difference between revisions of "WxHaskell/Troubleshooting"

From HaskellWiki
Jump to navigation Jump to search
(moved from install page)
 
(Added known inability to restart mainloop in GHCi)
Line 58: Line 58:
 
* sample applications terminate with following error message (Windows). <code>The applicattion failed to initialize properly (0xc0150002). Click OK to terminate the application.</code>
 
* sample applications terminate with following error message (Windows). <code>The applicattion failed to initialize properly (0xc0150002). Click OK to terminate the application.</code>
 
** <b>Solution</b>: install [http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647&DisplayLang=en Microsoft Visual C++ 2005 SP1 Redistributable Package].
 
** <b>Solution</b>: install [http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647&DisplayLang=en Microsoft Visual C++ 2005 SP1 Redistributable Package].
  +
* 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.
   
 
== Old issues ==
 
== Old issues ==

Revision as of 12:24, 20 October 2008

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!

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

Runtime issues

  • sample applications just sit there doing nothing (MacOS X)
    • Solution: macosx-app the application
  • 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.

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