Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Disabling warnings

Disabling warnings

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 4.0k Views 1 Watching
  • 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.
  • K Offline
    K Offline
    Kaluss
    wrote on last edited by
    #1

    Hey all,
    does somone know how to disable all kinds of warnings from selected file.

    Many thanks
    Thomas

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      What warnings? What files? What is generating the warnings?

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        welcome to devnet

        as ChrisW67 already indicates you need to give more details.

        When compiling Qt libs on your own you are typically facing a lot of warnings. However, those might be annoying, but they are harmless. As long as the compilation does not end with an error message.

        Unfortunately, some of Qt headers cause warnings in your code and they are dependent on the compiler and its version. You need to consult the documentation on how to actually switch them off.

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

        1 Reply Last reply
        0
        • K Offline
          K Offline
          Kaluss
          wrote on last edited by
          #4

          Hey,
          the problem is with BasicExcel library which I use in my app. It's generates a lot of basic warnings like unsigned/signed int comparison and thus that I have to seek for my own problems in the sea of warings.

          Basically I try to keep my app without warinings at all thus this situation is a bit annoying for me :)

          What I'm looking for is any possibilty to tell compiler to not to show any warnigs during compiltion this library.

          Any ideas ?
          Maybe somone knows some other free cpp library which allows to read form xls and xlsx files ?

          Will be grateful for any help.
          BR
          Tom

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            How is any one supposed to know that you are using a non Qt lib and which one ? ;-)

            There are other possibilities discussed here in the forum. You might want to check out "excel tag":https://qt-project.org/search/tag/excel but others like active X may be helpful as well.

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

            1 Reply Last reply
            0
            • K Offline
              K Offline
              Kaluss
              wrote on last edited by
              #6

              Ok, thanks, but u still don't understand my question.

              Am I able to turn off the all kinds of warnings for selected file and not for all compilation process?

              Many thanks
              Tomas

              1 Reply Last reply
              0
              • K Offline
                K Offline
                koahnig
                wrote on last edited by
                #7

                You probably have to use #pragma statements in your source for switching off these warnings.
                However, those pragmas are dependent on your compiler. This is the only way for single source files AFAIK.
                Since you are compiling a library you may want to put the whole lib source into a separate project. You can have also your main application in a separate project. Using the "subdirs template":http://qt-project.org/doc/qt-5/qmake-variable-reference.html#subdirs with qmake allows you to choose different compiler switches for individual projects.
                On the other hand if you have different projects, you might not be bothered so much with warnings for the lib source itself.
                However, when the headers of the lib are causing the warnings in your application you are back to pragmas.

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

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  Kaluss
                  wrote on last edited by
                  #8

                  Thanks.
                  I use VS a bit and pragma/override/seald and e.t.c are stricly connected with windows compiler.

                  I will check those excel tags about which You posted before. Maybe it allows me to abandon this shity library :)

                  Thanks for Your help

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    ChrisW67
                    wrote on last edited by
                    #9

                    If you are using Microsoft's compiler:
                    http://msdn.microsoft.com/en-us/library/2c8f766e.aspx

                    If you are using GCC:
                    http://dbp-consulting.com/tutorials/SuppressingGCCWarnings.html

                    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