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

Sharing data between static library and main executable program

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 267 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.
  • S Offline
    S Offline
    supratik123
    wrote on 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
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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
      • fcarneyF Offline
        fcarneyF Offline
        fcarney
        wrote on last edited by
        #3

        Shouldn't this work?

        extern int somevariable;
        

        C++ is a perfectly valid school of magic.

        1 Reply Last reply
        1

        • Login

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