Creating a shared and static library with the gnu compiler [gcc]

René Nyffenegger's collection of things on the web René Nyffenegger on Oracle - Most wanted - Feedback - Follow @renenyffenegger Here's a summary on how to create a shared and a static library with gcc. The goal is to show the basic steps. I do not want to go into the hairy details. It should be possible to use this page as a reference. These examples were tested and run on cygwin/Windows. This is the code that goes into the library. It exhibits one single function that takes two doubles and calculates their mean value and returns it. calc_mean.c //#include <stdio.h> double mean (double a, double b) { return (a+b) / 2; } Of course, we need a header file. calc_mean.h double mean(double, double); A static library is basically a set of object files that were copied into a single file. This single file is the static library. The static file is...

Linked on 2016-01-27 22:10:22 | Similar Links