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. Static library compatibility amid different intel cpu
Forum Updated to NodeBB v4.3 + New Features

Static library compatibility amid different intel cpu

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 3 Posters 2.5k Views 2 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.
  • A Offline
    A Offline
    AlterX
    wrote on last edited by
    #1

    Hello,
    I am experiencing a problem of compatibility with a static library I created using i7 processor. When I try to link this library on another project on a intel dual core (I think i3), then I have some error like "bad value format" or something like that. I have to recompile the static library unsing i3 to avoid that linkage problem.
    So I am trying to make the static library without optimization for a specific cpu and to achieve this I put in my pro file:
    QMAKE_CXXFLAGS+=-mtune=generic

    but it seems to be not effective...I read about -m32 and -m64 but I don't know if this is the case.
    Is there someone that can help me?

    Qt Ambassador
    Real-time cooperative teams: http://www.softairrealfight.net
    Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

    https://codereview.qt-project.org/...

    1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      It should not be related to i7/i3.
      Do you use the same compiler for the other project?
      Which compilers do you use?
      Is your library 32 or 64 bit binary?
      Is the other project built as 32 or 64 bit binary?
      What is the platform (Windows/Linux(MacOS)?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • A Offline
        A Offline
        AlterX
        wrote on last edited by
        #3

        Hello, I know that shouldn't impact the cpu...but for some reason the one built by i7 is not working on the i3.
        On both I use Qt 5.6 framework, so same default compiler and chain, exclusively 64bit for the static lib and for the project I am trying to link the library with.
        All project are on linux systems, the only difference is kubuntu on i7 and gentoo on i3

        Qt Ambassador
        Real-time cooperative teams: http://www.softairrealfight.net
        Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

        https://codereview.qt-project.org/...

        1 Reply Last reply
        0
        • jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I'm quite sure the compilers on Kubuntu and Gentoo are not same. That would explain the problem.
          You can check the gcc version on both machines via

          gcc -v
          

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply
          0
          • jsulmJ jsulm

            I'm quite sure the compilers on Kubuntu and Gentoo are not same. That would explain the problem.
            You can check the gcc version on both machines via

            gcc -v
            
            A Offline
            A Offline
            AlterX
            wrote on last edited by
            #5

            @jsulm
            But since I am using Qt Creator it should use its own provided compiler...or maybe I am wrong?

            Anyway I will check the gcc version on both system, but they should be both 4.9.x and the ABI should be compatible for the major version

            Qt Ambassador
            Real-time cooperative teams: http://www.softairrealfight.net
            Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

            https://codereview.qt-project.org/...

            JohanSoloJ 1 Reply Last reply
            0
            • A AlterX

              @jsulm
              But since I am using Qt Creator it should use its own provided compiler...or maybe I am wrong?

              Anyway I will check the gcc version on both system, but they should be both 4.9.x and the ABI should be compatible for the major version

              JohanSoloJ Offline
              JohanSoloJ Offline
              JohanSolo
              wrote on last edited by
              #6

              @AlterX said:

              But since I am using Qt Creator it should use its own provided compiler...or maybe I am wrong?

              No, QtCreator is only an IDE, it doesn't contain a compiler.

              @AlterX said:

              Anyway I will check the gcc version on both system, but they should be both 4.9.x and the ABI should be compatible for the major version

              Well, this is OK for shared libraries IIRC, but for static ones you need exactly the same compiler and glibc versions, otherwise everything blows up.

              `They did not know it was impossible, so they did it.'
              -- Mark Twain

              A 1 Reply Last reply
              1
              • JohanSoloJ JohanSolo

                @AlterX said:

                But since I am using Qt Creator it should use its own provided compiler...or maybe I am wrong?

                No, QtCreator is only an IDE, it doesn't contain a compiler.

                @AlterX said:

                Anyway I will check the gcc version on both system, but they should be both 4.9.x and the ABI should be compatible for the major version

                Well, this is OK for shared libraries IIRC, but for static ones you need exactly the same compiler and glibc versions, otherwise everything blows up.

                A Offline
                A Offline
                AlterX
                wrote on last edited by
                #7

                @JohanSolo said:

                @AlterX said:

                But since I am using Qt Creator it should use its own provided compiler...or maybe I am wrong?

                No, QtCreator is only an IDE, it doesn't contain a compiler.

                Ok I was speaking about Qt framework and not QtCreator only. But I think you are right.

                @AlterX said:

                Anyway I will check the gcc version on both system, but they should be both 4.9.x and the ABI should be compatible for the major version

                Well, this is OK for shared libraries IIRC, but for static ones you need exactly the same compiler and glibc versions, otherwise everything blows up.

                And so what if I want to distribute a static library to be used by everyone?

                Qt Ambassador
                Real-time cooperative teams: http://www.softairrealfight.net
                Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

                https://codereview.qt-project.org/...

                JohanSoloJ 1 Reply Last reply
                0
                • A AlterX

                  @JohanSolo said:

                  @AlterX said:

                  But since I am using Qt Creator it should use its own provided compiler...or maybe I am wrong?

                  No, QtCreator is only an IDE, it doesn't contain a compiler.

                  Ok I was speaking about Qt framework and not QtCreator only. But I think you are right.

                  @AlterX said:

                  Anyway I will check the gcc version on both system, but they should be both 4.9.x and the ABI should be compatible for the major version

                  Well, this is OK for shared libraries IIRC, but for static ones you need exactly the same compiler and glibc versions, otherwise everything blows up.

                  And so what if I want to distribute a static library to be used by everyone?

                  JohanSoloJ Offline
                  JohanSoloJ Offline
                  JohanSolo
                  wrote on last edited by
                  #8

                  @AlterX said:

                  And so what if I want to distribute a static library to be used by everyone?

                  Well, either you tell people which compiler / glibc version they should use, or you build one library for each combination you want to support. The last possibility I see is to distribute the sources, so that people who want to use your library just have to compile it.

                  Or you can of course distribute a shared library... which is what most people do.

                  `They did not know it was impossible, so they did it.'
                  -- Mark Twain

                  A 1 Reply Last reply
                  0
                  • JohanSoloJ JohanSolo

                    @AlterX said:

                    And so what if I want to distribute a static library to be used by everyone?

                    Well, either you tell people which compiler / glibc version they should use, or you build one library for each combination you want to support. The last possibility I see is to distribute the sources, so that people who want to use your library just have to compile it.

                    Or you can of course distribute a shared library... which is what most people do.

                    A Offline
                    A Offline
                    AlterX
                    wrote on last edited by AlterX
                    #9

                    @JohanSolo said:

                    @AlterX said:

                    And so what if I want to distribute a static library to be used by everyone?

                    Well, either you tell people which compiler / glibc version they should use, or you build one library for each combination you want to support. The last possibility I see is to distribute the sources, so that people who want to use your library just have to compile it.

                    Or you can of course distribute a shared library... which is what most people do.

                    If it is like this, then this is really painful...But I used some static libraries from 3rd party...and it was working...can't be just a case I had the same glibc and compiler!

                    Qt Ambassador
                    Real-time cooperative teams: http://www.softairrealfight.net
                    Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

                    https://codereview.qt-project.org/...

                    JohanSoloJ 1 Reply Last reply
                    0
                    • A AlterX

                      @JohanSolo said:

                      @AlterX said:

                      And so what if I want to distribute a static library to be used by everyone?

                      Well, either you tell people which compiler / glibc version they should use, or you build one library for each combination you want to support. The last possibility I see is to distribute the sources, so that people who want to use your library just have to compile it.

                      Or you can of course distribute a shared library... which is what most people do.

                      If it is like this, then this is really painful...But I used some static libraries from 3rd party...and it was working...can't be just a case I had the same glibc and compiler!

                      JohanSoloJ Offline
                      JohanSoloJ Offline
                      JohanSolo
                      wrote on last edited by
                      #10

                      @AlterX said:

                      If it is like this, then this is really painful...But I used some static libraries from 3rd party...and it was working...can't be just a case I had the same glibc and compiler!

                      This goes beyond my expertise... But I think it requires at least the glibc version to be `similar'. Hopefully somebody with additional knowledge can comment on this.

                      `They did not know it was impossible, so they did it.'
                      -- Mark Twain

                      A 1 Reply Last reply
                      0
                      • JohanSoloJ JohanSolo

                        @AlterX said:

                        If it is like this, then this is really painful...But I used some static libraries from 3rd party...and it was working...can't be just a case I had the same glibc and compiler!

                        This goes beyond my expertise... But I think it requires at least the glibc version to be `similar'. Hopefully somebody with additional knowledge can comment on this.

                        A Offline
                        A Offline
                        AlterX
                        wrote on last edited by
                        #11

                        @JohanSolo
                        Ok anyway thanks...it is always good when ideas meet together!

                        Qt Ambassador
                        Real-time cooperative teams: http://www.softairrealfight.net
                        Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

                        https://codereview.qt-project.org/...

                        1 Reply Last reply
                        0
                        • jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          Is there a reason why you want to distribute a static library and not shared?

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            AlterX
                            wrote on last edited by
                            #13

                            Anyway I made an error in the project settings...I was linking a static lib in a dynamic lib.

                            Qt Ambassador
                            Real-time cooperative teams: http://www.softairrealfight.net
                            Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

                            https://codereview.qt-project.org/...

                            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