Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7760681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:57:13+00:00 2026-06-01T13:57:13+00:00

I want to use the Discount C-library to convert Markdown text into HTML. I

  • 0

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 ininto 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:57:14+00:00Added an answer on June 1, 2026 at 1:57 pm

    Try this instead:

    gcc -Wall -o FILE FILE.c -lmarkdown
    

    The placement of -l is significant in that many linkers will only use libraries to satisfy unresolved references if they exist at the time when the -l is parsed. This can cause all sorts of problems with circular dependencies, for example.

    Where you have it originally, those functions aren’t unresolved since you haven’t yet compiled FILE.c. When you do compile FILE.c, there’s no -l following that point to satisfy the references.

    From the gcc man-page:

    Order does matter when you use several options of the same kind; for example, if you specify -L more than once, the directories are searched in the order specified. Also, the placement of the -l option is significant.

    And, later, under -l:

    It makes a difference where in the command you write this option; the linker searches and processes libraries and object files in the order they are specified. Thus, foo.o -lz bar.o searches library z after file foo.o but before bar.o. If bar.o refers to functions in z, those functions may not be loaded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want use some data from a website with web service. i have a
I have a transaction log file in CSV format that I want use to
I have a easy select tag: <select> <option></option> <option></option> </select> Then I want use
i want to use title on text. is this possible to make title on
I have class in server side and I want use method of this class
I want use a typedef struct that isn't already defined, but it is later.
i want use select statement on the a table and inserting result into a
I want use ORDER BY RAND() query mysql. But I have some question want
I need to use HTML comments to store specific data, but I don't want
I want use A-Z buttons on a html page like shown below (only sample

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.