pdf - 编译haru text_demo.c 错误

在 Redhat Linux 上下载并安装 2.2.1 并尝试编译 text_demo.c,但它提示缺少 grid_sheet.h。所以我下载了2.0.8来获取grid_sheet.h。现在,当我尝试编译时,出现以下错误:

gcc -o text_demo -I /usr/local/include I /home/downloads/libharu-2.0.8/demo -L /usr/local/lib text_demo.c

/tmp/ccmPxCcu.o: In function show_stripe_pattern': text_demo.c:(.text+0x68): undefined reference to HPDF_Page_SetRGBStroke' text_demo.c:(.text+0x7c): undefined reference to HPDF_Page_SetLineWidth' text_demo.c:(.text+0xa6): undefined reference toHPDF_Page_MoveTo' text_demo.c:(.text+0xd0): undefined reference to HPDF_Page_TextWidth' text_demo.c:(.text+0xe9): undefined reference toHPDF_Page_LineTo' text_demo.c:(.text+0xf4): undefined reference to HPDF_Page_Stroke' text_demo.c:(.text+0x116): undefined reference toHPDF_Page_SetLineWidth' /tmp/ccmPxCcu.o: In function show_description': text_demo.c:(.text+0x129): undefined reference to HPDF_Page_GetCurrentFontSize' text_demo.c:(.text+0x137): undefined reference to HPDF_Page_GetCurrentFont' text_demo.c:(.text+0x14c): undefined reference toHPDF_Page_GetRGBFill' text_demo.c:(.text+0x15a): undefined reference to HPDF_Page_BeginText' text_demo.c:(.text+0x180): undefined reference toHPDF_Page_SetRGBFill' text_demo.c:(.text+0x193): undefined reference to HPDF_Page_SetTextRenderingMode' text_demo.c:(.text+0x1ae): undefined reference to HPDF_Page_SetFontAndSize' text_demo.c:(.text+0x1d6): undefined reference to HPDF_Page_TextOut' text_demo.c:(.text+0x1e1): undefined reference toHPDF_Page_EndText' text_demo.c:(.text+0x1fa): undefined reference to HPDF_Page_SetFontAndSize' text_demo.c:(.text+0x21a): undefined reference toHPDF_Page_SetRGBFill' /tmp/ccmPxCcu.o: In function main': text_demo.c:(.text+0x2ab): undefined reference to HPDF_New' text_demo.c:(.text+0x2ea): undefined reference to HPDF_Free' text_demo.c:(.text+0x30c): undefined reference to HPDF_SetCompressionMode' text_demo.c:(.text+0x327): undefined reference to HPDF_GetFont' text_demo.c:(.text+0x335): undefined reference toHPDF_AddPage' text_demo.c:(.text+0x34a): undefined reference to print_grid' text_demo.c:(.text+0x365): undefined reference toHPDF_Page_SetFontAndSize' text_demo.c:(.text+0x377): undefined reference to HPDF_Page_TextWidth' text_demo.c:(.text+0x385): undefined reference to HPDF_Page_BeginText' text_demo.c:(.text+0x390): undefined reference to HPDF_Page_GetHeight' text_demo.c:(.text+0x3a9): undefined reference toHPDF_Page_GetWidth' text_demo.c:(.text+0x3d4): undefined reference to HPDF_Page_TextOut' text_demo.c:(.text+0x3df): undefined reference toHPDF_Page_EndText' text_demo.c:(.text+0x3ea): undefined reference to HPDF_Page_BeginText' text_demo.c:(.text+0x3f5): undefined reference toHPDF_Page_GetHeight' text_demo.c:(.text+0x415): undefined reference to HPDF_Page_MoveTextPos' text_demo.c:(.text+0x43b): undefined reference toHPDF_Page_SetFontAndSize' text_demo.c:(.text+0x45c): undefined reference to HPDF_Page_MoveTextPos' text_demo.c:(.text+0x47c): undefined reference toHPDF_Page_GetWidth' text_demo.c:(.text+0x4aa): undefined reference to HPDF_Page_MeasureText' text_demo.c:(.text+0x4cd): undefined reference toHPDF_Page_ShowText' text_demo.c:(.text+0x4ea): undefined reference to HPDF_Page_MoveTextPos' text_demo.c:(.text+0x505): undefined reference toHPDF_Page_SetFontAndSize' text_demo.c:(.text+0x53f): undefined reference to HPDF_Page_ShowText' text_demo.c:(.text+0x57c): undefined reference toHPDF_Page_SetFontAndSize' text_demo.c:(.text+0x599): undefined reference to HPDF_Page_MoveTextPos' text_demo.c:(.text+0x5ac): undefined reference toHPDF_Page_ShowText' text_demo.c:(.text+0x5c7): undefined reference to HPDF_Page_SetFontAndSize' text_demo.c:(.text+0x5e4): undefined reference toHPDF_Page_MoveTextPos' text_demo.c:(.text+0x665): undefined reference to HPDF_Page_SetRGBFill' text_demo.c:(.text+0x67a): undefined reference toHPDF_Page_ShowText' text_demo.c:(.text+0x6a3): undefined reference to HPDF_Page_MoveTextPos' text_demo.c:(.text+0x6fe): undefined reference toHPDF_Page_SetRGBFill' text_demo.c:(.text+0x713): undefined reference to HPDF_Page_ShowText' text_demo.c:(.text+0x73c): undefined reference toHPDF_Page_MoveTextPos' text_demo.c:(.text+0x797): undefined reference to HPDF_Page_SetRGBFill' text_demo.c:(.text+0x7ac): undefined reference toHPDF_Page_ShowText' text_demo.c:(.text+0x7c3): undefined reference to HPDF_Page_EndText' text_demo.c:(.text+0x7e6): undefined reference to HPDF_Page_SetFontAndSize' text_demo.c:(.text+0x80c): undefined reference to HPDF_Page_SetRGBFill' text_demo.c:(.text+0x820): undefined reference toHPDF_Page_SetLineWidth' text_demo.c:(.text+0x856): undefined reference to HPDF_Page_SetTextRenderingMode' text_demo.c:(.text+0x861): undefined reference toHPDF_Page_BeginText' text_demo.c:(.text+0x884): undefined reference to HPDF_Page_TextOut' text_demo.c:(.text+0x88f): undefined reference toHPDF_Page_EndText' text_demo.c:(.text+0x8cd): undefined reference to HPDF_Page_SetTextRenderingMode' text_demo.c:(.text+0x8d8): undefined reference to HPDF_Page_BeginText' text_demo.c:(.text+0x903): undefined reference to HPDF_Page_TextOut' text_demo.c:(.text+0x90e): undefined reference toHPDF_Page_EndText' text_demo.c:(.text+0x94c): undefined reference to HPDF_Page_SetTextRenderingMode' text_demo.c:(.text+0x957): undefined reference toHPDF_Page_BeginText' text_demo.c:(.text+0x982): undefined reference to HPDF_Page_TextOut' text_demo.c:(.text+0x98d): undefined reference toHPDF_Page_EndText' text_demo.c:(.text+0x9c3): undefined reference to HPDF_Page_GSave' text_demo.c:(.text+0x9d6): undefined reference to HPDF_Page_SetTextRenderingMode' text_demo.c:(.text+0x9e1): undefined reference to HPDF_Page_BeginText' text_demo.c:(.text+0xa0c): undefined reference toHPDF_Page_TextOut' text_demo.c:(.text+0xa17): undefined reference to HPDF_Page_EndText' text_demo.c:(.text+0xa45): undefined reference toHPDF_Page_GRestore' text_demo.c:(.text+0xa7b): undefined reference to HPDF_Page_GSave' text_demo.c:(.text+0xa8e): undefined reference toHPDF_Page_SetTextRenderingMode' text_demo.c:(.text+0xa99): undefined reference to HPDF_Page_BeginText' text_demo.c:(.text+0xac4): undefined reference toHPDF_Page_TextOut' text_demo.c:(.text+0xacf): undefined reference to HPDF_Page_EndText' text_demo.c:(.text+0xafd): undefined reference toHPDF_Page_GRestore' text_demo.c:(.text+0xb33): undefined reference to HPDF_Page_GSave' text_demo.c:(.text+0xb46): undefined reference to HPDF_Page_SetTextRenderingMode' text_demo.c:(.text+0xb51): undefined reference to HPDF_Page_BeginText' text_demo.c:(.text+0xb7c): undefined reference toHPDF_Page_TextOut' text_demo.c:(.text+0xb87): undefined reference to HPDF_Page_EndText' text_demo.c:(.text+0xbb5): undefined reference toHPDF_Page_GRestore' text_demo.c:(.text+0xbc8): undefined reference to HPDF_Page_SetTextRenderingMode' text_demo.c:(.text+0xbee): undefined reference to HPDF_Page_SetRGBFill' text_demo.c:(.text+0xc09): undefined reference to HPDF_Page_SetFontAndSize' text_demo.c:(.text+0xc5d): undefined reference toHPDF_Page_BeginText' text_demo.c:(.text+0xc79): undefined reference to cos' text_demo.c:(.text+0xc8a): undefined reference tosin' text_demo.c:(.text+0xcb3): undefined reference to sin' text_demo.c:(.text+0xcc4): undefined reference tocos' text_demo.c:(.text+0xd0a): undefined reference to HPDF_Page_SetTextMatrix' text_demo.c:(.text+0xd1d): undefined reference toHPDF_Page_ShowText' text_demo.c:(.text+0xd28): undefined reference to HPDF_Page_EndText' text_demo.c:(.text+0xd5e): undefined reference toHPDF_Page_BeginText' text_demo.c:(.text+0xdb6): undefined reference to tan' text_demo.c:(.text+0xdc7): undefined reference totan' text_demo.c:(.text+0xe11): undefined reference to HPDF_Page_SetTextMatrix' text_demo.c:(.text+0xe24): undefined reference toHPDF_Page_ShowText' text_demo.c:(.text+0xe2f): undefined reference to HPDF_Page_EndText' text_demo.c:(.text+0xe65): undefined reference toHPDF_Page_BeginText' text_demo.c:(.text+0xeac): undefined reference to HPDF_Page_SetTextMatrix' text_demo.c:(.text+0xebf): undefined reference toHPDF_Page_ShowText' text_demo.c:(.text+0xeca): undefined reference to HPDF_Page_EndText' text_demo.c:(.text+0xf00): undefined reference to HPDF_Page_BeginText' text_demo.c:(.text+0xf47): undefined reference to HPDF_Page_SetTextMatrix' text_demo.c:(.text+0xf5a): undefined reference toHPDF_Page_ShowText' text_demo.c:(.text+0xf65): undefined reference to HPDF_Page_EndText' text_demo.c:(.text+0xfef): undefined reference toHPDF_Page_SetFontAndSize' text_demo.c:(.text+0x1015): undefined reference to HPDF_Page_SetRGBFill' text_demo.c:(.text+0x1020): undefined reference to HPDF_Page_BeginText' text_demo.c:(.text+0x1044): undefined reference to HPDF_Page_TextOut' text_demo.c:(.text+0x104f): undefined reference toHPDF_Page_EndText' text_demo.c:(.text+0x1063): undefined reference to HPDF_Page_SetCharSpace' text_demo.c:(.text+0x106e): undefined reference toHPDF_Page_BeginText' text_demo.c:(.text+0x1092): undefined reference to HPDF_Page_TextOut' text_demo.c:(.text+0x109d): undefined reference toHPDF_Page_EndText' text_demo.c:(.text+0x10b1): undefined reference to HPDF_Page_SetWordSpace' text_demo.c:(.text+0x10bc): undefined reference to HPDF_Page_BeginText' text_demo.c:(.text+0x10e0): undefined reference to HPDF_Page_TextOut' text_demo.c:(.text+0x10eb): undefined reference toHPDF_Page_EndText' text_demo.c:(.text+0x1100): undefined reference to HPDF_SaveToFile' text_demo.c:(.text+0x110b): undefined reference toHPDF_Free' collect2: ld returned 1 exit status

最佳答案

由于找不到库,所有 libharu 函数都丢失了。请更改您的 -L 选项。

https://stackoverflow.com/questions/13036740/

相关文章:

sorting - "nonL value in assignment "错误 C++对链表进行排序

c# - asp.net代码显示编译器错误消息: CS1729: 'EmailReader.Pop3

qt - Qwt和Boost::signals

c# - 编译委托(delegate)和调度程序时出错

vector - 初始化4D向量

compiler-errors - 免费的基本编译器错误23 : File not found, l

compiler-errors - 我的部分产品生成器出了什么问题

compiler-errors - IPv4和IPv6地址的lex模式

opencv - CV_MAT_ELEM中的编译错误

compiler-errors - 如何使Groovy Shell读取#符号