Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Sharing data between static library and main executable program



  • 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.


  • Lifetime Qt Champion

    Hi,

    What variables are these ?
    What is their purpose ?



  • Shouldn't this work?

    extern int somevariable;
    

Log in to reply