p-ranav / tabulate

Table Maker for Modern C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to run the demo program

tsb131 opened this issue · comments

when I download the include floader,and I using the "#include<include/tabulate/table.hpp>,the compiler tell me that it can't find the file include/tabulate/table.hpp,but when I use "" to replace <>,it can,but int the header file table.hpp,it also can't find other header files in include foader,because it use <>

What compiler are you using? Are you familiar with include_directories?

You can add some set of directories to those the compiler uses to search for include files. Relative paths are interpreted as relative to the current source directory.

Let's say you have a demo.cpp in the root of this repository - in this file, you include the tabulate headers like so:

#include <tabulate/table.hpp>

You can compile it like so:

$ g++ -std=c++17 -Iinclude -o demo demo.cpp

The -Iinclude option adds the include/ directory of the repo to the compiler's search. Then you can use #include <tabulate/table.hpp> and the compiler will find this path inside the include/ directory.

You can build all the samples in this project using cmake - see here.

I'd recommend you learn more about (1) how to use your compiler, (2) how to include header files and make the compilation work, (3) using cmake.