Dani Pa
Dani Pa

Reputation: 23

How add shared-library to my library project in QT

May i load external library in my library project? If yes. How i can do this. With Qlibrary? or typically include in pro file LIBS += -L /lib -lmylib and add *.h file to project?

Sorry for my English))))

Upvotes: 1

Views: 8186

Answers (2)

Andrey Semenov
Andrey Semenov

Reputation: 971

Yes you can. If you want to use shared library just add in you application *.pro file

LIBS+=-Llibrary_location_path -llibraryName
INCLUDEPATH += library_headers_location

Check original documentation http://doc.qt.io/qt-5/third-party-libraries.html

P.S. I suppose you understand that .h files contains declaration of methods that you are going to use in your appplication, while library contains implementation of this methods

Upvotes: 2

Gurushant
Gurushant

Reputation: 942

Just go to your respective Qt .pro file in Qt Creator IDE itself, and right click on empty area and choose "Add Library", Select external Library and click next, now click on browse in front of include path text box and choose the .lib file you want to include and select the platforms you want to target and now click next and finish the process. To add .h file, first copy the .h file in your project folder, and right click on the header under solution explorer, and click on add existinf file, now select your .h file and add it.

Upvotes: 5

Related Questions