-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C++] Linker Error when building arrow bundled dependencies with MSVC #36117
Comments
Could you specify git clone https://github.com/apache/arrow.git
cd arrow/cpp
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DARROW_PARQUET=ON -DARROW_CSV=ON -DARROW_BUILD_STATIC=ON ..
cmake --build . --config Release --target install |
I ran each of those commands specifically while explicitly stating the build type and It seems to produce the same error.
|
Could you show the outpuf of |
This is the output:
|
Hmm... Could you add a debug message and run again? diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake
index aaf4b0bb5..3bf44c4d2 100644
--- a/cpp/cmake_modules/BuildUtils.cmake
+++ b/cpp/cmake_modules/BuildUtils.cmake
@@ -140,7 +140,7 @@ function(arrow_create_merged_static_lib output_target)
${BUNDLE_COMMAND}
DEPENDS ${ARG_ROOT} ${ARG_TO_MERGE}
BYPRODUCTS ${output_lib_path}
- COMMENT "Bundling ${output_lib_path}"
+ COMMENT "Bundling ${output_lib_path}: ${BUNDLE_COMMAND}"
VERBATIM)
message(STATUS "Creating bundled static library target ${output_target} at ${output_lib_path}" |
Here's the output from that comment:
|
Could you run |
Hopefully, I ran this correctly, but I'm uncertain because I got an error. I navigated to the folder
and then ran the following command:
and i got this error:
|
Oh... We can't get more information... |
@kou I got the same exact same error on a fresh windows install |
Does this work? diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake
index aaf4b0bb5..a9bdd0391 100644
--- a/cpp/cmake_modules/BuildUtils.cmake
+++ b/cpp/cmake_modules/BuildUtils.cmake
@@ -86,6 +86,7 @@ function(arrow_create_merged_static_lib output_target)
message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}")
endif()
+ file(MAKE_DIRECTORY ${BUILD_OUTPUT_ROOT_DIRECTORY})
set(output_lib_path
${BUILD_OUTPUT_ROOT_DIRECTORY}${CMAKE_STATIC_LIBRARY_PREFIX}${ARG_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
) |
If it doesn't exist when we build arrow_bundled_dependencies.lib, "lib.exe ..." failed. This also includes cleanup of lib.exe detection related codes but it's not related of this fix. Sorry. "file(MAKE_DIRECTORY)" is only important.
### Rationale for this change If it doesn't exist when we build arrow_bundled_dependencies.lib, "lib.exe ..." failed. ### What changes are included in this PR? Ensure creating it in `cmake ...` phase not build phrase. This also includes cleanup of lib.exe detection related codes but it's not related of this fix. Sorry. "file(MAKE_DIRECTORY)" is only important. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * Closes: #36117 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Describe the bug, including details regarding any error messages, version, and platform.
I was trying to do a static build of arrow in my project and ran into a linker error. Here are the exact commands I ran:
After running those commands, during the build process, I get the following error.
Any help would be greatly appreciated.
Component(s)
C++
The text was updated successfully, but these errors were encountered: