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. How to link libstdc++ statically to shared lib project?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.4k 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.
  • S Offline
    S Offline
    shyam_777
    wrote on last edited by
    #1

    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.

    jsulmJ 1 Reply Last reply
    0
    • S shyam_777

      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.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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
      3
      • S Offline
        S Offline
        shyam_777
        wrote on last edited by
        #3

        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
        0

        • Login

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