dongqin6926
dongqin6926
2015-04-03 17:21
浏览 731

将文件添加到/ usr / local / include

I recently installed openjtalk on a linux machine, and I want to be able to wrap it in Go. The source files for openjtalk have several subfolders with different sources, which I assume are found by the compiler because of the make files.

Should I copy each of those sub-folders into /usr/local/include? Is that a "correct" way of fixing include dependencies. From what I tested, Go seems to find the included files if I copy them, but I'm not sure if this is the correct, linux way of doing things.

图片转代码服务由CSDN问答提供 功能建议

我最近在Linux机器上安装了openjtalk,我希望能够将其包装在Go中。 openjtalk的源文件有几个带有不同源的子文件夹,我认为这些子文件夹是由于make文件而由编译器找到的。

我应该将每个子文件夹复制到 的/ usr /本地/包括? 这是修复包含依赖项的“正确”方法吗? 根据我的测试,如果我复制包含的文件,Go似乎会找到包含的文件,但是我不确定这是否是正确的Linux处理方式。

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dtlc84438
    dtlc84438 2015-04-03 20:46
    已采纳

    It's usually not a good idea to change locations of external libraries. Some libraries automatically put themselves in include paths of compilers but for those that don't, adding their paths to the compilers' include paths is always a better idea.

    For example, in gcc, you can gcc -I/your/header/directory to include your directory. Usually people put those info in the Makefile. This way, you can put external libraries' source code in your repository and just tell compiler to also look for the headers there. This way, when setting up a new working environment, all you have to do is pull from the repository.

    点赞 评论

相关推荐