tinyrpc icon indicating copy to clipboard operation
tinyrpc copied to clipboard

error:no such file <tinyxml/tinyxml.h>

Open lanpoo opened this issue 3 years ago • 10 comments

When I compile the project, the error message is In file included from tinyrpc/comm/log.cc:16: tinyrpc/comm/config.h:4:10: fatal error: tinyxml/tinyxml.h: No such file or directory How should I solve it?

lanpoo avatar May 10 '22 16:05 lanpoo

Hi, you should install 'tinyxml' library first.

https://github.com/leethomason/tinyxml2

Gooddbird avatar May 10 '22 16:05 Gooddbird

or this link address 'https://sourceforge.net/projects/tinyxml/'

Gooddbird avatar May 10 '22 16:05 Gooddbird

Modify 85 line in makefile of tinyxml form 'OUTPUT := xmltest' to 'OUTPUT := libtinyxml.a '

  1. make
  2. copy libtinyxml.a to your sys lib path like '/usr/lib'
  3. copy all '%.h' file in tinyxml to your sys include path like '/usr/include'

Gooddbird avatar May 10 '22 16:05 Gooddbird

... 还以为你不是中国人。 害我编了大堆英语。 感谢对此项目的关注。目前可能还有些 BUG 没优化,如果遇到啥问题欢迎随时反馈。

tinyxml 的安装可以参考: https://blog.csdn.net/lcli2009/article/details/21445805

Gooddbird avatar May 10 '22 16:05 Gooddbird

... 还以为你不是中国人。 害我编了大堆英语。 感谢对此项目的关注。目前可能还有些 BUG 没优化,如果遇到啥问题欢迎随时反馈。

tinyxml 的安装可以参考: https://blog.csdn.net/lcli2009/article/details/21445805

哈哈哈好的,谢谢,我会照着试试的。感谢您的回答~一开始用英语提问是因为我的虚拟机里没有装中文输入法hhhh

lanpoo avatar May 10 '22 17:05 lanpoo

顺便提下,拷贝的时候要注意路径。 tinyxml.h 前面还有个 tinyxml 路径,所以拷贝到 /lib/ 目录下时可以先建立个 tinyxml 文件夹,再往里拷贝 .h 文件。

Gooddbird avatar May 10 '22 17:05 Gooddbird

好,万分感谢!很难得能遇到您这么有耐心的作者了,知乎给您点关注了~🤭

lanpoo avatar May 10 '22 17:05 lanpoo

很抱歉又来打扰您,关于_tinyxml2_的依赖库问题我已经解决了。但是紧接着它又爆了个错。 fatal error: google/protobuf/message.h: No such file or directory 请问关于这个库,我该去哪个git仓库下安装呢?

lanpoo avatar May 10 '22 17:05 lanpoo

您好,需要安装 google 的 protobuf 库。 https://github.com/protocolbuffers/protobuf 可以百度一下安装方法

Gooddbird avatar May 11 '22 01:05 Gooddbird

大哥,头文件和库都有但是出现未定义标识符是怎么回事儿啊 ‘TiXmlElement’ has not been declared void readDBConfig(TiXmlElement* node);

wangseem avatar Aug 21 '23 15:08 wangseem