Linker problems on ARM-based Macs

未关闭
#50 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
c, cmake, macos

调研方向

Start by reproducing the reported cmake . and cmake --build . failure on an ARM-based Mac. Inspect the modules/wiremock target and impl.c, then determine why the listed Testcontainers symbols are missing during linking; done means the CMake build links testcontainers-c-wiremock successfully for arm64.

由索引模型根据 Issue 内容生成。

描述

We have a problem when linking on modern MacBooks. I have not delved deep into exactly what about the linking that is wrong but here's the output.

ha@Hampuss-MacBook-Pro testcontainers-native % cmake . -DCMAKE_POLICY_VERSION_MINIMUM=3.5
-- Found Python: /opt/homebrew/Frameworks/Python.framework/Versions/3.13/bin/python3.13 (found version "3.13.5") found components: Interpreter
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done (1.4s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/ha/Source/testcontainers-native
ha@Hampuss-MacBook-Pro testcontainers-native % cmake --build .
[  5%] Building Testcontainers C shared library
[  5%] Built target testcontainers-c-shim
[ 11%] Building C object modules/wiremock/CMakeFiles/testcontainers-c-wiremock.dir/impl.c.o
[ 17%] Linking C shared library libtestcontainers-c-wiremock.dylib
Undefined symbols for architecture arm64:
  "_tc_new_container_request", referenced from:
      _tc_wm_new_container in impl.c.o
  "_tc_send_http_get", referenced from:
      _tc_wm_get_mappings in impl.c.o
  "_tc_with_exposed_tcp_port", referenced from:
      _tc_wm_new_container in impl.c.o
  "_tc_with_file", referenced from:
      _tc_wm_with_mapping in impl.c.o
  "_tc_with_wait_for_http", referenced from:
      _tc_wm_new_container in impl.c.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [modules/wiremock/libtestcontainers-c-wiremock.0.0.1.dylib] Error 1
make[1]: *** [modules/wiremock/CMakeFiles/testcontainers-c-wiremock.dir/all] Error 2
make: *** [all] Error 2
主要语言
C
星标
58
派生
14
PR 合并指标
30 天内没有已合并 PR

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

testcontainers/testcontainers-native 的其他 Issue

查看 testcontainers/testcontainers-native 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。