[
https://issues.apache.org/jira/browse/ARROW-15500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17486556#comment-17486556
]
Ryan Seghers commented on ARROW-15500:
--------------------------------------
The root cause was giving libarrow.a to the linker before libparquet.a. The
dependent one must come first (because the linker drops unreferenced symbols
and it hasn't seen the references to the symbols yet if not), and libparquet.a
depends on libarrow.a.
The vcpkg usage for arrow lists the libraries in the wrong order. Here is the
usage that vcpkg prints when you install arrow:
find_package(Arrow CONFIG REQUIRED)
target_link_libraries(main PRIVATE ${ARROW_LIBRARIES})
find_package(Parquet CONFIG REQUIRED)
target_link_libraries(main PRIVATE ${PARQUET_LIBRARIES})
The parquet lib needs to come before the arrow lib. So I believe this is
basically a doc bug, where the order should be reversed in vcpkg repo in
ports/arrow/usage.
> parquet link undefined reference to base64_encode(), unpack32(), etc
> --------------------------------------------------------------------
>
> Key: ARROW-15500
> URL: https://issues.apache.org/jira/browse/ARROW-15500
> Project: Apache Arrow
> Issue Type: Bug
> Components: Parquet
> Affects Versions: 6.0.1
> Environment: ubuntu 20.04
> vcpkg master latest as of 2022-01-08, and tag 2022.01.01
> gcc 9 and 10 latest
> cmake 3.22.1
> Reporter: Ryan Seghers
> Priority: Minor
>
> I'm trying to build on ubuntu 20.04, using vcpkg master latest, both gcc-9
> and gcc-10 latest, cmake 3.22.1. I can build and link Arrow in a small test
> program and write a csv. When I try to build with parquet I get several
> link-time errors. Here is the first full linker error:
> /usr/bin/ld:
> /home/ryans/src/vcpkg/installed/x64-linux/lib/libparquet.a(writer.cc.o): in
> function `parquet::arrow::GetSchemaMetadata(arrow::Schema const&,
> arrow::MemoryPool*, parquet::ArrowWriterProperties const&,
> std::shared_ptr<arrow::KeyValueMetadata const>*) [clone .localalias]':
> writer.cc:(.text+0x179): undefined reference to
> `arrow::util::base64_encode[abi:cxx11](nonstd::sv_lite::basic_string_view<char,
> std::char_traits<char> >)'
> Here are snippets from the rest:
> undefined reference to `arrow::internal::unpack32(unsigned int const*,
> unsigned int*, int, int)'
> undefined reference to `arrow::internal::unpack64(unsigned char const*,
> unsigned long*, int, int)'
> undefined reference to `arrow::io::BufferedInputStream::Create(long,
> arrow::MemoryPool*, std::shared_ptr<arrow::io::InputStream>, long)'
> undefined reference to
> `arrow::util::base64_decode[abi:cxx11](nonstd::sv_lite::basic_string_view<char,
> std::char_traits<char> >)'
> I have tried vcpkg tag 2022.01.01 (I think it is Arrow 6.0.0) and looked like
> the same set of undefined symbols.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)