you should add 

find_package(Parquet REQUIRED)
target_link_libraries(parquet_test PRIVATE parquet_shared)

to your CMake setup. This will also then link the Parquet libraries in addition to the Arrow libraries. You need to use the FindParquet.cmake that is included in the Arrow sources.


On Thu, Jul 30, 2020, at 11:12 AM, Sebastian F wrote:
Hi everyone,

I am having some trouble using the C++ parquet Libraries, even to get the minimal examples working. Basically I am installing the arrow-cpp and cmake into a conda environment calling "conda install -c conda-forge arrow-cpp cmake". Using the minimal CMake example taken from the docs (https://arrow.apache.org/docs/cpp/cmake.html) I get as far as creating arrow tables. However if I try to compile this https://github.com/apache/arrow/blob/master/cpp/examples/parquet/parquet-arrow/reader-writer.cc, I get "undefined reference to `parquet::arrow::OpenFile" for basically everything that involves Parquet. Do I have to install or link more stuff to use Parquet? Searching the documentation did not get me very far, I could not find a working example for my configuration.
This is my CMakeLists:

cmake_minimum_required(VERSION 3.18)

find_package(Arrow REQUIRED)

message(STATUS "Arrow version: ${ARROW_VERSION}")
message(STATUS "Arrow SO version: ${ARROW_FULL_SO_VERSION}")

add_executable(parquet_test main.cpp)

target_link_libraries(parquet_test PRIVATE arrow_shared)

Trying find_package from here: https://github.com/apache/arrow/blob/master/cpp/examples/parquet/parquet-arrow/CMakeLists.txt just threw an Error and said it could not find anything. I hope this is not a stupid question, I am in no way a C++ pro.

Thanks very much!