Google Cloud Cpp找不到内部.h文件

Mortymacs

这是示例CPP文件,其中包含GCP头文件:

#include <google/cloud/storage/client.h>
#include <iostream>
int main(int argc, char* argv[]) {
    std::cout << "here i am!" << std::endl;
}

这是CMake文件:

add_subdirectory(gcp/super)
include_directories(gcp)
set(MYSRC mycode.cc)
add_executable(mycode ${MYSRC})
target_link_libraries(mycode storage_client)

但这会引发错误:

In file included from /home/morteza/google-cloud-cpp-0.20.0/mycode.cc:1:
/home/morteza/google-cloud-cpp-0.20.0/gcp/google/cloud/storage/client.h:18:10: fatal error: google/cloud/internal/disjunction.h: No such file or directory
   18 | #include "google/cloud/internal/disjunction.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/mycode.dir/build.make:63: CMakeFiles/mycode.dir/mycode.cc.o] Error 1

如您所见,这完全是GCP(client.h包含disjunction.h的内部部分

科尔班

看来您还需要在环境中添加以下内容:

https://github.com/googleapis/google-cloud-cpp-common

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章