我如何编译Sundown Markdown渲染器示例?保持返回错误 [英] How do I compile the Sundown Markdown Renderer example? Keeps returning errors

查看:128
本文介绍了我如何编译Sundown Markdown渲染器示例?保持返回错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

日落以前流行的Markdown编辑器包含一个示例目录,我想玩弄它在命令行上,但我有困难。



我导航到示例,我运行 gcc sundown.c -o sundown 它抱怨我没有 markdown.h 。因此,我将 src 目录和 html 目录的内容转储到示例类别中,然后运行它。



然后我得到:

 架构x86_64的未定义符号:
_bufgrow,引用自:
_main in sundown-3bac08.o
_bufnew,引用自:
_main in sundown-3bac08.o
_bufrelease ,引用自:
_main in sundown-3bac08.o
_sd_markdown_free,引用自:
_main in sundown-3bac08.o
_sd_markdown_new,引用自:
_main in sundown-3bac08.o
_sd_markdown_render,引用自:
_main in sundown-3bac08.o
_sdhtml_renderer,引用自:
_main in sundown- 3bac08.o

我在这里做错了什么?我觉得这应该是相对简单的,我只是想知道我在做什么错了。

解决方案

p>通过添加参数告诉g​​cc从何处获取#include文件:

 ' -  Ipathtoincludes'

code>

您可以通过添加参数告诉g​​cc从何处获取所需的库:

 ' -  Lpathtoolibrary'和'-lshortlibraryname 

注意: -l是小写'L'



库路径和库名参数必须在gcc命令行中最后一个,因为链接器查看在命令行中列出的顺序


Sundown a (formerly) popular Markdown editor includes an examples directory, and I want to play around with it on the command line, but I'm having difficulties.

I navigate to examples, I run gcc sundown.c -o sundown and it complains that I don't have markdown.h. So I dump the contents of the src directory and the html directory into the examples category, and run it.

I then get:

Undefined symbols for architecture x86_64:
  "_bufgrow", referenced from:
      _main in sundown-3bac08.o
  "_bufnew", referenced from:
      _main in sundown-3bac08.o
  "_bufrelease", referenced from:
      _main in sundown-3bac08.o
  "_sd_markdown_free", referenced from:
      _main in sundown-3bac08.o
  "_sd_markdown_new", referenced from:
      _main in sundown-3bac08.o
  "_sd_markdown_render", referenced from:
      _main in sundown-3bac08.o
  "_sdhtml_renderer", referenced from:
      _main in sundown-3bac08.o

What exactly am I doing wrong here? I feel like this should be relatively simple, I'm just at wits end trying to figure out what I'm doing wrong.

解决方案

you tell gcc where to obtain #include files by adding the parameter:

'-Ipathtoincludes'

you tell gcc where to obtain the needed libraries by adding the parameters:

'-Lpathtoolibrary' and '-lshortlibraryname

note: the -l is lower case 'L'

The library path and library name parameters must be last in the gcc command line, as the linker looks at the linker parameters in the order listed on the command line

这篇关于我如何编译Sundown Markdown渲染器示例?保持返回错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆