gpt4 book ai didi

c++ - 如何使文件 "db/file.c"能够通过 Premake 5 说#include "db/file.h"?

转载 作者:行者123 更新时间:2023-11-28 06:21:38 26 4
gpt4 key购买 nike

Google 的 LevelDB 是一个很好的库。然而它只有 linux 的编译文件。它有一些过时的 Windows 端口和说明,如 this one from Microsoft .说明已过时。我希望能够在具有单个配置文件的 Windows 和 Linux 上编译最新的 leveldb,因此我使用 premake 来创建配置。

他们使用有趣的策略。有一个 db/file.cc他们引用了它的内容:

#include "db/file.h"

我想知道如何制作 premake 配置解决方案,以便所有文件在项目根目录“/”中看到它们自己,即使它们位于“/db/”文件夹中。还是有其他方法可以做到这一点?

最佳答案

您需要将包含文件搜索路径设置为项目根目录。

includedirs { "." }

关于c++ - 如何使文件 "db/file.c"能够通过 Premake 5 说#include "db/file.h"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29214455/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com