You are here:

C++/linking libraries


I'm trying to run through a C++ tutorial where I have to link to a .lib file to get the program to work. How do you do this? Is it a command you type into the file or something you accomplish via the GUI? (I'm using DevC++ Version 5.0)

Greg , Thank you for your question.

Linking to a .lib file is done by the linker, not the C++ compiler. Most compilers come with a linker. When you build a project from an Interactive Development Environment, the environment will maintain information associated with the project, including the list of .lib files to be linked.

Some C++ compilers also support a C++ "#pragma" command so you can specify .lib files in the C++ source file itself.

David Spector


All Answers

Answers by Expert:

Ask Experts


David Spector


Highly knowledgeable in the C++ language, Visual C++ (MSVC), Windows API, documentation and other quality-assurance techniques, and debugging. Knowledgeable in MFC, COM, GUI design, and object-oriented design.


I have been a software engineer since 1965. I have been published. My specializations have been: biomedical programming, compiler implementation, and many kinds of Windows programming. I don't do Databases or other business-oriented stuff.

Windows?/DOS Developer's Journal, ACM SIGPLAN Notices, and Computer Science Press.

ICCP Systems Programming Certification
Master's degree equivalent in Computer Science

©2017 All rights reserved.