[CentOS, Eclipse] Load a library file in a C project

Thing you want to do

I want to add a C library to an Eclipse C project and use the API in the library

environment

manner

1. Copy the library file

  1. Create an "include" directory
  2. Store the inside of the directory containing the library (.lib) in the project directory. (When you make the shapefile library, a directory called .lib is created, and the library file is in it.)
  3. Copy the shapefil.h file and store it in the" include "directory created in your project

2. Library definition settings

  1. Right-click on the project "Properties"-> "C / C ++ Build"-> "Settings"-> "Tool Settings" project.png
  2. Specify the folder that stores ".lib" in "G ++ Linker"-> "Library"-> "Library Path"
  3. Enter "shp" in "G ++ Linker"-> "Library"-> "Library" (specify "shp" instead of "libshp" in the file name)

Where I got stuck

URL that I used as a reference

How the C library works

eclipse settings

Recommended Posts

[CentOS, Eclipse] Load a library file in a C project
I made a Ruby extension library in C
Create a base for your batch processing project in Eclipse.
Create a tomcat project using Eclipse Pleiades All in One
Create a Jetty project using Eclipse
Read Java properties file in C #
Create a tomcat project using Eclipse
Create a Java project using Eclipse
Created a selfish configuration file library
Create a Servlet program in Eclipse
Make a SOAP call in C #
Make the context root a project folder in an Eclipse dynamic web project
Building a Lambda development environment in Eclipse
How to publish a library in jCenter
Deploy a Tomcat-based Eclipse project on Heroku
What to do if you get Could not save master table to file after importing a project in Eclipse
Set the source of the library set as a dependency in IntelliJ as a separate module of the project
Let's create a versatile file storage (?) Operation library by abstracting file storage / acquisition in Java
Add .gitignore when creating a project in Xcode
Read a string in a PDF file with Java
Run a Spring Boot project in VS Code
Create a simple batch processing framework in Eclipse.
Run JUnit and Spock in a maven project
[Eclipse / Tomcat] Servlet + JSP in Maven webapp project
A bat file that uses Java in windows
Java tips-Create a Spring Boot project in Gradle
Add a project in any folder with Gradle
When the project is not displayed in eclipse
How to automatically generate a constructor in Eclipse
What to do when "Fail to load the JNI shared library" is displayed in Eclipse