Skip to content

wk1093/libheader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libheader

lh

A file type that encapsualtes a header (.h), and a static library (.lib/.a)

should be able to be #include by normal C, but requires a special linker that can recognize a .lh file

Example

main.c

#include "sample/test.lh"

int main() {
    testfunc();
    return 0;
}

test.h

#include <stdio.h>
void testfunc();

test.c

#include "test.h"
void testfunc() { printf("Hello, World!\n"); }
  • makelh test.h test.c creates a test.lh
  • gcclh main.c --lh=test.lh -o test.exe compiles using the test.lh file