hosseinmoein / DataFrame

C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ using native types and contiguous memory storage
https://hosseinmoein.github.io/DataFrame/
BSD 3-Clause "New" or "Revised" License
2.41k stars 306 forks source link

ERROR:undefined reference to 'hmdf::DateTime::DateTime::xxx' #210

Closed zhouhaoan closed 1 year ago

zhouhaoan commented 1 year ago

I have built the latest code(commit:9c9e949 ) in the repository and installed it. When I tried to compile the 'examples/hello_world.cc', a lot of link errors raised.

My compile instruction is g++ -o hello_test hello_world.cc -g -std=c++17 -I/usr/local/include

Here are versions of my tools:

OS : Ubuntu 20.04.3 LTS (kernel: 3.10.0-1160.el7.x86_64)
cmake : 3.16.3
make : GNU Make 4.2.1
gcc : 9.3.0
g++ : 9.3.0
ld : GNU ld 2.34

here are error outputs:

image

hosseinmoein commented 1 year ago

DataFrame is not a header-only library. You have to build the DataFrame library first, then your executable has to link with DataFrame library. Depending on your environment, you may have to link with other system libraries too.

Follow the instructions in README to build it using CMake. Or alternatively you can look at my makefiles in the src directory as a guid to build your own makefiles -- although I recommend CMake.

zhouhaoan commented 1 year ago

DataFrame is not a header-only library. You have to build the DataFrame library first, then your executable has to link with DataFrame library. Depending on your environment, you may have to link with other system libraries too.

Follow the instructions in README to build it using CMake. Or alternatively you can look at my makefiles in the src directory as a guid to build your own makefiles -- although I recommend CMake.

Thanks, I got it. I have to link to libDataFrame.a by a -l flag.