Sundown一个(以前)流行的Markdown编辑器包含一个示例目录,我想在命令行中使用它,但我遇到了困难。
我导航到examples
,我运行gcc sundown.c -o sundown
并抱怨我没有markdown.h
。因此,我将src
目录和html
目录的内容转储到示例类别中,然后运行它。
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
我到底错在了什么?我觉得这应该是相对简单的,我只是想知道我做错了什么。
答案 0 :(得分:0)
通过添加参数:
告诉gcc在哪里获取#include文件'-Ipathtoincludes'
通过添加参数告诉gcc在哪里获取所需的库:
'-Lpathtoolibrary' and '-lshortlibraryname
注意:-l是小写' L'
库路径和库名称参数必须在gcc命令行中最后,因为链接器按命令行中列出的顺序查看链接器参数