Book Image

Application Development with Qt Creator - Second Edition

Book Image

Application Development with Qt Creator - Second Edition

Overview of this book

Table of Contents (20 chapters)
Application Development with Qt Creator Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Linking against our sample library


Now, let's make an application that depends on our library. Our application will call the factorial function in the library, statically linking to the library in order to access the factorial function. To accomplish this, you need to perform the following steps:

  1. Select Close All Projects and Editors from the File menu.

  2. Choose New File or Project… from the File menu and create a new Qt console application called MathFunctionsTest using the wizard.

  3. Right-click on MathFunctionsTest in the Project pane and click on Add Library.... You can now choose a library in your build tree, a library outside your build tree, an external library on your system such as the Unix math library, fftmpeg, or another library that you've created. Select External Library and click on Next.

  4. Browse the library file that was built in the previous section by clicking on Browse, next to the line labelled Library file. It'll be in a folder named something such as build-MathFunctions-Desktop_Qt_5_3_0_MinGW_32bit...