Results 1 to 2 of 2

Thread: Compilation problems with MinGW

  1. #1
    Join Date
    Mar 2010
    Posts
    92
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Compilation problems with MinGW

    I successfully compiled Boost with MinGW (GCC 4.4.0 - it came
    > installed with the Qt SDK) with all the settings on, so it has
    > generated both dynamic and static libraries, debug and release
    > versions, multithreaded and non-multithreaded runtimes etc. I tried to
    > compile a small program that uses the serialization library


    > and tried to link it statically with these libraries (in different
    > compilations):

    LIBS += "D:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/Boost_Mingw/lib/libboost_filesystem-mgw34-mt.lib"
    LIBS += "D:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/Boost_Mingw/lib/libboost_system-mgw34-mt.lib"
    LIBS += "D:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/Boost_Mingw/lib/libboost_thread-mgw34-mt.lib"
    Each time I compiled, it would always give me linker errors like so:

    > undefined reference to `__gxx_personality_sj0'
    > undefined reference to `_Unwind_SjLj_Register'
    > undefined reference to `_Unwind_SjLj_Unregister'
    > undefined reference to `_Unwind_SjLj_Resume'


    Qt Code:
    1. #include <boost/filesystem/operations.hpp>
    2. #include <iostream>
    3. namespace fs = boost::filesystem;
    4. int main( int argc, char* argv[] )
    5. {
    6. if ( argc != 2 )
    7. {
    8. std::cout << "Usage: file_size path\n";
    9. return 1;
    10. }
    11. std::cout << "sizeof(intmax_t) is " << sizeof(boost::intmax_t) << '\n';
    12. fs::path p( argv[1], fs::native );
    13.  
    14. if ( !fs::exists( p ) )
    15. {
    16. std::cout << "not found: " << argv[1] << std::endl;
    17. return 1;
    18. }
    19. if ( !fs::is_regular( p ) )
    20. {
    21. std::cout << "not a regular file: " << argv[1] << std::endl;
    22. return 1;
    23. }
    24. std::cout << "size of " << argv[1] << " is " << fs::file_size( p )
    25. << std::endl;
    26. return 0;
    27. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2008
    Location
    France
    Posts
    149
    Thanks
    2
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compilation problems with MinGW

    It seems that your Qt was compiled with gcc4.2 (with exceptions type SJLJ model)
    According to gcc 4.4.0 :
    "- Zero cost exceptions: New exception model Dwarf only has performance
    penalty when being thrown. The old model, SJLJ, is no longer
    available."

    SJLJ has been removed and exceptions generate link errors .
    Rebuild Qt with gcc4.4.0 and it should be fine.

Similar Threads

  1. SDK vs. own compilation
    By codeman in forum Installation and Deployment
    Replies: 19
    Last Post: 20th October 2009, 10:50
  2. Replies: 5
    Last Post: 29th August 2007, 09:12
  3. Compilation problems with QT 4.3.1
    By mansoorulhaq in forum Qt Programming
    Replies: 2
    Last Post: 20th August 2007, 09:47
  4. problems about cross-compilation qte to arm
    By slient in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 10th April 2007, 16:59
  5. Compilation without......
    By ball in forum Installation and Deployment
    Replies: 1
    Last Post: 28th January 2006, 21:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.