Skip to content

Instantly share code, notes, and snippets.

@bobbyg603
Created July 31, 2022 10:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobbyg603/1155d1d5b91c9b30fdec0299dc917ec6 to your computer and use it in GitHub Desktop.
Save bobbyg603/1155d1d5b91c9b30fdec0299dc917ec6 to your computer and use it in GitHub Desktop.
How to Build a Linux Shared Library
// Allows us to reference built-in standard library input/output functions
#include <stdio.h>
+#include "mars.h"
// Our function implementation int (return type) main (function name) void (parameter type)
int main(void)
{
// Use standard library to print to the terminal window
puts("Hello Earth!");
+ // Call a function in our shared library
+ mars();
// Exit with a return code 0 indicating success
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment