Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. RTTI symbol not found for class

RTTI symbol not found for class

Scheduled Pinned Locked Moved Qt Creator and other tools
10 Posts 6 Posters 38.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    daviddoria
    wrote on 17 Aug 2012, 18:24 last edited by
    #1

    When debugging my code, I am seeing:

    RTTI symbol not found for class 'itk::Region'

    in the Application Output. Despite the errors, everything seems to be working fine. Is there a way to suppress these errors?

    Thanks,

    David

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on 18 Aug 2012, 08:16 last edited by
      #2

      Sorry, for taking your sentences literal, but there are some significant differences.

      • The only way to suppress errors is to fix them.
      • If you want to suppress error messages, you shall think twice before ignoring respectively suppressing them.
      • Those are warnings (messages), you should think twice before ignoring those.

      RTTI is used to determine which method to use during run-time. IMHO I consider those at least as error message even so you might read "warning" somewhere. The RTTI would activate all my alarm bells.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      2
      • D Offline
        D Offline
        daviddoria
        wrote on 18 Aug 2012, 13:08 last edited by
        #3

        No, no, I agree with you fully. The reason I thought they were just "QtCreator warnings" is that I have worked with this code for years and never seen g++ or gdb complain about anything (even with -Wall). Furthermore, these errors are occurring at run-time, which I have not seen anything like.

        So what could I look for to fix the errors?

        Thanks,

        David

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on 18 Aug 2012, 13:37 last edited by
          #4

          What is your OS?
          Which compiler/tool chain are you using? Is it still gcc?
          Did you compile one of the libs yourself?
          Most compilers have a possibility of switch RTTI support on and off. So it could be the reason RTTI support has switch ignored.

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          1
          • D Offline
            D Offline
            daviddoria
            wrote on 18 Aug 2012, 14:02 last edited by
            #5

            Linux (Ubuntu 12.04). Yes, g++ 4.6.3.

            Yes, I compiled ITK (the library that it seems to be complaining about) by myself. Interesting - which flags should I try to recompile it with?

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on 18 Aug 2012, 14:21 last edited by
              #6

              "http://lmgtfy.com/?q=gcc+rtti+support":http://lmgtfy.com/?q=gcc+rtti+support
              You need to dig through those. I have found immediately "this here":http://gcc.gnu.org/onlinedocs/gcc-4.4.3/gcc/C_002b_002b-Dialect-Options.html but it refers to RTTI as being switched off. So, it is suggesting that the default it is switched on, but you need to check. Especially for your specific compiler version.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              1
              • T Offline
                T Offline
                tobias.hunger
                wrote on 18 Aug 2012, 15:28 last edited by
                #7

                RunTime Type Information is generated by the compiler to describe relations between types at run time. This information is generated by default, but compilers can be asked to skip generating it to save some space. In general that works, but anything that needs this information will then fail. This is most notably dynamic_cast, which will return 0 pointer. Since the code using dynamic casts will usually handle those 0 pointers the code tends to not crash, but it won't deliver the desired results either. I am really happy to hear compilers produce warnings about those issues now... I did spend hours before trying to figure out why some dynamic casts fail for no obvious reason whatsoever:-)

                Either turn on RTTI in your library or avoid using dynamic_cast with the types defined in that library. If those types are QObjects you can e.g. use qobject_cast which uses the information from Qts Metatype system instead of RTTI.

                H 1 Reply Last reply 4 Jun 2020, 19:53
                2
                • D Offline
                  D Offline
                  Duck
                  wrote on 18 Aug 2012, 21:16 last edited by
                  #8

                  The error message stems from gdb and also appears from time to time on harmless code. It's most likely a problem in the debug info, either the way gcc creates it, or the way gbd reads it.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    Szyk Cech
                    wrote on 11 May 2018, 19:56 last edited by
                    #9

                    Main reason of "RTTI symbol not found for class" are wrong paths in qt.conf in your DESTDIR or in your install dir.

                    1 Reply Last reply
                    0
                    • T tobias.hunger
                      18 Aug 2012, 15:28

                      RunTime Type Information is generated by the compiler to describe relations between types at run time. This information is generated by default, but compilers can be asked to skip generating it to save some space. In general that works, but anything that needs this information will then fail. This is most notably dynamic_cast, which will return 0 pointer. Since the code using dynamic casts will usually handle those 0 pointers the code tends to not crash, but it won't deliver the desired results either. I am really happy to hear compilers produce warnings about those issues now... I did spend hours before trying to figure out why some dynamic casts fail for no obvious reason whatsoever:-)

                      Either turn on RTTI in your library or avoid using dynamic_cast with the types defined in that library. If those types are QObjects you can e.g. use qobject_cast which uses the information from Qts Metatype system instead of RTTI.

                      H Offline
                      H Offline
                      HR_Parisa
                      wrote on 4 Jun 2020, 19:53 last edited by HR_Parisa 6 Apr 2020, 19:56
                      #10

                      @tobias-hunger
                      Hi
                      How can I turn on RTTI ?

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved