首页 > 解决方案 > 由于缺少包含路径,无法构建使用 Swig 构建的 go 模块

问题描述

在我的 swig 接口文件中,我使用包括:

%{
    #include "lib-cpp/types/lists/linked-list.hpp"
%}
%include "lib-cpp/types/lists/linked-list.hpp"

但是,当我运行 go install 时,我得到:

navdb_go_client_wrap.cxx:258:14: fatal error: 'lib-cpp/types/lists/linked-list.hpp' file not found

如何为 go install 指定包含目录?

标签: goswig

解决方案


将 CPLUS_INCLUDE_PATH 导出到所需的包含路径修复了此问题。


推荐阅读