Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved How to link libstdc++ statically to shared lib project?

    General and Desktop
    2
    3
    482
    Loading More Posts
    • 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.
    • S
      shyam_777 last edited by

      Hi All,
      Problem abstract: I have build a code one gcc version and trying to run .out file in another gcc/g++ version PC, executable app not launching.

      I have tried to set the QMAKE_LFLAGS += -static-libgcc -static-libstdc++, is there any way to link the flags and also tried -Bstatic -lstdc++. these are doesn't work for me. Can you please help me on this issue.

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @shyam_777 last edited by

        @shyam_777 said in How to link libstdc++ statically to shared lib project?:

        executable app not launching

        Are you sure the problem is libstdc++?
        I doubt it is going to work if you link libstdc++ statically, but other libraries dynamically - these other libraries will still expect other libstdc++ version. If you want to link statically then link all libs statically.
        Or build on other PC with required libstdc++ version.

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

        1 Reply Last reply Reply Quote 3
        • S
          shyam_777 last edited by

          Thank you Sir for reply,
          "Are you sure the problem is libstdc++?"
          Yeah sure , the app build in gcc 7.5 version in Jenkins and trying to launch in 16.04 with gcc version 5.4 , app is not launching . Installed 8.4 gcc version and then verified app is launching.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post