I want to use the Discount C-library to convert Markdown text into HTML. I have already successfully compiled and installed the library (version 2.1.3).
I tried to compile this code
#include <mkdio.h>
int main(void)
{
FILE *in, *out;
MMIOT *doc;
in = fopen("sample.md", "r");
out = fopen("out.html", "w");
doc = mdk_in(in, 0);
markdown(doc, out, 0);
...
}
Explanation: mkd_in()
reads the input file in
into the library working-type MMIOT doc
and markdown() should convert doc
to HTML and writes is to the out
file.
with the command gcc -Wall -lmarkdown -o FILE FILE.c
and I always get the following output:
undefined reference to `mkd_in(_IO_FILE*, unsigned int)'
undefined reference to `markdown(void*, _IO_FILE*, unsigned int)'
Note: I've run the configuration tool of Discount with the --shared
option to build a dynamic library. Default is a static library but with that I've got the same problem.