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. Sharing data between static library and main executable program
Forum Update on Monday, May 27th 2025

Sharing data between static library and main executable program

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 186 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
    supratik123
    wrote on 3 Sept 2019, 11:07 last edited by
    #1

    Hi All I am newbie to Qt. I have created a static library where I am doing some functions and I want some of the variables declared in the static library to be accessible to my main program or the program which I will bind my static library using the includepath and lib. I have heard about Qshared pointer but I am not sure whether it will serve my purpose.
    If anyone can help me in making the variables visible to main program by any other means other than signals and slots , it will be great.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Sept 2019, 18:39 last edited by
      #2

      Hi,

      What variables are these ?
      What is their purpose ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fcarney
        wrote on 3 Sept 2019, 18:41 last edited by
        #3

        Shouldn't this work?

        extern int somevariable;
        

        C++ is a perfectly valid school of magic.

        1 Reply Last reply
        1

        1/3

        3 Sept 2019, 11:07

        • Login

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