You are here:

C++/linking libraries

Advertisement


Question
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)

Answer
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

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


David Spector

Expertise

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.

Experience

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.

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

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

©2016 About.com. All rights reserved.