PDA

View Full Version : Adding library in another project



Anshuman
26th April 2011, 08:15
Actually i hv one pushButton in different project file and on the click of push button it should refer to a Mainwindow which is present in another project file..i created the lib file of one project say test.pro in the below way..

TEMPLATE=lib
CONFIG+=dll

After writing this code in test.pro file and when i build it..i get two files test.a and test.dll in test-buildsimulator folder..

Now i added this path of the lib file in my test1.pro file in the following way....


win32:
{
LIBS += -L../test-build-simulator/debug
}
LIBS += -ltest
}

wether i am proceeding correctly....

Now on click of pushButton that is present in test1 project i hv written the code as below

void Mainwindow::on_Clicked_PushButton()
{
Mainwindow1 a(this); //this window is present in test project
a.show();
}

the error i am getting is Mainwindow1 is not found..plz help me

mcosta
26th April 2011, 16:13
You have to set INCLUDEPATH in your pro file