C++ All-in-One For Dummies
Book image
Explore Book Buy On Amazon
Creating a library project in C++ is only a little different than creating a console application. The following steps describe how to create a library project:

Choose File→New→Project.

Choose File→New→Project.

You see the New From Template dialog box shown.

Highlight the Static Library icon on the Projects tab, then click Go.

You see the Welcome page of the Static Library wizard.

Click Next.

Click Next.

You see a list of project-related questions. These questions define project basics, such as the project name.

Type a name for your project in the Project Title field.

The example uses MathLibrary as the project title. Notice that the wizard automatically starts creating an entry for you in the Project Filename field.

Type a location for your project in the Folder to Create Project In field.

(Optional) Type a project filename in the Project Filename field.

Click Next.

Click Next.

You see the compiler settings shown. This example uses the default compiler settings. However, it’s important to remember that you can choose a different compiler, modify the locations of the debug and release versions of the project, and make other changes as needed. Code::Blocks provides the same level of customization for libraries as it does for applications.

Change any required compiler settings and click Finish.

The wizard creates the application for you. It then displays the Code::Blocks IDE with the project loaded. Note that the Static Library project includes some sample code to get you started. You could compile this library and test it now.

About This Article

This article is from the book:

About the book author:

John Mueller has produced 114 books and more than 600 articles on topics ranging from functional programming techniques to working with Amazon Web Services (AWS). Luca Massaron, a Google Developer Expert (GDE),??interprets big data and transforms it into smart data through simple and effective data mining and machine learning techniques.

This article can be found in the category: