I am trying to compile a small piece of C++ code, linking against the arrow
libraries which I retrieved through Anaconda (conda install -c conda-forge
arrow-cpp).

The minified code for test.cpp looks like this,

>>
#include <arrow/status.h>
#include <iostream>

void checkStatus(arrow::Status const &status) {
  if (!status.ok()) {
    std::cout << status.ToString() << std::endl;
  }
}
<<

and the build command looks like (conda/build is a local anaconda env with
the necessary libs),

g++ test.cpp -Iconda/build/include -Lconda/build/lib -lboost_system
-lboost_filesystem -larrow

This gives the following error,

>>
/usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/crt1.o: In function
`_start':
(.text+0x20): undefined reference to `main'
/tmp/ccXSAIRl.o: In function `checkStatus(arrow::Status const&)':
test.cpp:(.text+0x2f): undefined reference to
`arrow::Status::ToString[abi:cxx11]() const'
collect2: error: ld returned 1 exit status
<<

Is this something that rings a bell to someone? I've tried a bunch of
things, but can't immediately see what the issue is. I'm using G++ 7.3.1 on
Fedora 26.

It's likely I'm just doing this completely wrong, though, so any pointers
to get me on the right path would be very helpful!

Thanks,
-J

Reply via email to