Under the “Link libraries” window, press the “Add” button and add the library you wish your project to use. A) Right click on the bolded project name under the default workspace (probably “Console application”, unless you changed it).Ĭhoose “Build options” from the menu. We do this on an individual project basis. Step 5 - Tell the linker which libraries your program is using For step 5, we need to add the library files from the library to our project. If you are running Linux and installed the library via a package manager, make sure /usr/lib is listed here. Press the “Add” button, and add the path to the.lib files for the library. If you are running Linux and installed the library via a package manager, make sure /usr/include is listed here. The compiler tab will already be selected for you.Ĭ) Press the “Add” button, and add the path to the.h files for the library. A) Go to the “Settings menu” and pick “Compiler”. Steps 3 and 4 - Tell the compiler where to find headers and library files We are going to do this on a global basis so the library will be available to all of our projects.Ĭonsequently, the following steps only need to be done once per library. See the tutorial on for more information about this step. Steps 1 and 2 - Acquire and install library Download and install the library to your hard disk. 6) #include the library’s header file(s) in your program.ħ) Make sure the program know where to find any dynamic libraries being used. Once per project: 5) Tell the linker which static or import library files to link. 3) Tell the compiler where to look for the header file(s) for the library.Ĥ) Tell the linker where to look for the library file(s) for the library. Unzip it to a directory or install it via a package manager. Download it from the website or via a package manager. To recap the process needed to use a library: Once per library: 1) Acquire the library. If it does not work for some reason, you may have to provide a different name (for example the library is named gdi32.lib for MSVC). You can also write the library's full name, but writing libgdi32.a has no advantage over gdi32 other than being more type work.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |