无法在ubuntu 14.04中使用包含库 – > pokerstove

伙计们! 我刚刚在这个网站及其用户的帮助下,通过良好的指示包括了这个pokerstove库

我在我的主目录中运行了所有命令

围梁@围梁-的ThinkPad-E520:〜$

安装所有必要的工具后,命令就是这些

git clone https://github.com/andrewprock/pokerstove.git mkdir pokerstove/src/build cd pokerstove/src/build cmake .. make 

如你所见,我最终进入了这个目录

围梁@围梁-的ThinkPad-E520:〜/ pokerstove / src目录/编译$

我成功运行了这个库的创建者建议运行的命令

girts @ girts-ThinkPad-E520:〜/ pokerstove / src / build $ bin / ps-eval

之前我还安装了boost库并测试它们工作得很好现在我尝试编译这个简单的ggg.cpp文件,其中也包含这些新的pokerstove库这里是代码

 #include  #include  #include  #include  #include  #include  #include  #include  #include  int main(){ std::cout << "Hello World!" << std::endl; } 

当我尝试使用编译时

girts @ girts-ThinkPad-E520:〜/ pokerstove / src / build $ g ++ -o programma ggg.cpp

编译器给了我这个错误

 ggg.cpp:8:42: fatal error: pokerstove/util/combinations.h: No such file or directory #include  ^ compilation terminated. 

有什么我做错了吗? (当然,否则就没有这个问题)也许安装在我不应该或类似的地方?

添加包含文件的路径:

 $ g++ -o programma ggg.cpp -I/home//pokerstove/src/lib $ ./programma Hello World! 

-I – 指定搜索头文件的目录

例如:

  $ find -name combinations.h ./pokerstove/src/lib/pokerstove/util/combinations.h 

因此使用相对路径: ./pokerstove/src/lib/
或绝对路径: /home//pokerstove/src/lib/