arrow-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "auderson" <auder...@qq.com>
Subject why I can't use `arrow::py::import_pyarrow()' in c++
Date Tue, 18 May 2021 08:09:05 GMT
Hi,


I'm using arrow-cpp 4.0.0 installed from conda. I also have pyarrow 4.0.0 installed.


In my test.cpp file, import_pyarrow() will throw an error: undefined reference to `arrow::py::import_pyarrow()'


#mini_example.cpp
#include "mini_example.h"
#include <arrow/python/pyarrow.h&gt;

int main() {
    arrow::py::import_pyarrow();
}

&nbsp;#mini_example.h


#include <arrow/python/pyarrow.h&gt;
int main() {
    arrow::py::import_pyarrow();
}


#CMakeLists.txt


cmake_minimum_required(VERSION 3.10.0)
project(TEST)
set(CMAKE_CXX_STANDARD 17)

list(APPEND CMAKE_PREFIX_PATH "/home/auderson/miniconda3/lib/cmake/arrow")
find_package(Arrow REQUIRED)


include_directories(.
        /home/auderson/miniconda3/include
        /home/auderson/miniconda3/include/python3.8)

add_executable(TEST
        mini_example.cpp
        )

target_link_libraries(${PROJECT_NAME} PRIVATE /home/auderson/miniconda3/lib/libpython3.8.so)
target_link_libraries(${PROJECT_NAME} PRIVATE arrow_shared)The full output:CMakeFiles/TEST.dir/mini_example.cpp.o:
In function `main': /tmp/tmp.vmULkzpuYF/mini_example.cpp:9: undefined reference to `arrow::py::import_pyarrow()'
collect2: error: ld returned 1 exit statusBut other functionalities works fine, like create
an Array then build a Table from them. In fact I'm just stuck at the last step where I have
to wrap the table so that they can be passed to cython.Can you find where I'm doing wrong?
Thanks!Auderson
Mime
View raw message