udata.cpp:未定义的引用`iCudt71_dat'

发布于 2025-02-05 18:32:53 字数 1890 浏览 4 评论 0原文

我在

/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x23
/home/bkey1/vcpkg/installed/x64-linux/debug/lib/libicuuc.a(udata.ao): in function `openCommonData(char const*, int, UErrorCode*)':
udata.cpp:(.text+0x23f7): undefined reference to `icudt71_dat'
/usr/bin/ld: udata.cpp:(.text+0x2458): undefined reference to `icudt71_dat'

链接命令如下。

usr/bin/cmake -E cmake_link_script CMakeFiles/now.dir/link.txt --verbose=1
/usr/bin/c++  -std=c++2a -Wall -Wextra -Wfloat-equal -Wno-long-long -Wpedantic -funsigned-char -D_GNU_SOURCE=1 -rdynamic CMakeFiles/now.dir/GetStardate.cpp.o CMakeFiles/now.dir/GetTime.cpp.o CMakeFiles/now.dir/GetTimePlatformPOSIX.cpp.o CMakeFiles/now.dir/GetTimePlatformWin32.cpp.o CMakeFiles/now.dir/ISO8601_time.cpp.o CMakeFiles/now.dir/InitLocale.cpp.o CMakeFiles/now.dir/executable_path.cpp.o CMakeFiles/now.dir/now.cpp.o CMakeFiles/now.dir/nowStrings.cpp.o -o now  /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_chrono.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_filesystem.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_locale.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_log.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_program_options.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_regex.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_system.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_thread.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_date_time.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_log_setup.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_atomic.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libicudata.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libicui18n.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libicuuc.a 

I am getting an odd ICU related linking error in the now project when building on Ubuntu 22.04.

/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x23
/home/bkey1/vcpkg/installed/x64-linux/debug/lib/libicuuc.a(udata.ao): in function `openCommonData(char const*, int, UErrorCode*)':
udata.cpp:(.text+0x23f7): undefined reference to `icudt71_dat'
/usr/bin/ld: udata.cpp:(.text+0x2458): undefined reference to `icudt71_dat'

The link command is as follows.

usr/bin/cmake -E cmake_link_script CMakeFiles/now.dir/link.txt --verbose=1
/usr/bin/c++  -std=c++2a -Wall -Wextra -Wfloat-equal -Wno-long-long -Wpedantic -funsigned-char -D_GNU_SOURCE=1 -rdynamic CMakeFiles/now.dir/GetStardate.cpp.o CMakeFiles/now.dir/GetTime.cpp.o CMakeFiles/now.dir/GetTimePlatformPOSIX.cpp.o CMakeFiles/now.dir/GetTimePlatformWin32.cpp.o CMakeFiles/now.dir/ISO8601_time.cpp.o CMakeFiles/now.dir/InitLocale.cpp.o CMakeFiles/now.dir/executable_path.cpp.o CMakeFiles/now.dir/now.cpp.o CMakeFiles/now.dir/nowStrings.cpp.o -o now  /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_chrono.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_filesystem.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_locale.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_log.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_program_options.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_regex.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_system.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_thread.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_date_time.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_log_setup.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libboost_atomic.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libicudata.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libicui18n.a /home/bkey1/vcpkg/installed/x64-linux/debug/lib/libicuuc.a 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

红焚 2025-02-12 18:32:53

首先,我想强调,提供的信息很少,因此我自己的答案很可能需要猜测正在发生的事情。另一方面,我了解您的情况:您不知道您不知道与该主题有关的信息。

答案:
我想提请您注意一个事实,即符号ICUDT71_DAT不会直接出现在代码中的任何位置,而是使用宏生成。 (检查.../source/common/unicode/utypes.h)因此,如果链接器抱怨没有找到这样的符号,则很可能意味着您正在针对图书馆的不同版本链接到与标题的不同版本。现在,我不知道这可能是多么具体,我必须看到您的系统,包括路径,链接路径等。但是我强烈建议您重新访问包括和链接路径。您也许可以重新编译库,验证,没有其他版本重新编译,然后重新开始。如果标题与源相对应,则应起作用。

First I would like to stress, that there is very little information provided, so the answers such as my own will most likely need to guess what is happening. On the other hand I understand your situation: you cannot include info, that you don't know is relevant to the topic.

Answer:
I would like to draw your attention to the fact, that the symbol icudt71_dat does not appear anywhere in the code directly, but is generated using a macro. (Check .../source/common/unicode/utypes.h) So if the linker complains about not having found such a symbol it most probably means you are linking against a different version of the library than you have a header for. Now I don't know how specifically this could have happened, I would have to see your system, include path, link path etc. However I strongly suggest to revisit both include and link paths. You could perhaps recompile the library, verify, there is no other version recompile and start again. If the header corresponds to the source, it should work.

紅太極 2025-02-12 18:32:53

如果将ICU与静态库链接,则可能是链接的订单重要,请尝试以下操作:

  list(APPEND ICU_LINK_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/../third_party/icu4c/lib/${TARGET_PLATFORM_NAME}/libicui18n.a)
  list(APPEND ICU_LINK_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/../third_party/icu4c/lib/${TARGET_PLATFORM_NAME}/libicuuc.a)
  list(APPEND ICU_LINK_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/../third_party/icu4c/lib/${TARGET_PLATFORM_NAME}/libicudata.a)
  list(APPEND ICU_LINK_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/../third_party/icu4c/lib/${TARGET_PLATFORM_NAME}/libicuio.a)
  list(APPEND ICU_LINK_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/../third_party/icu4c/lib/${TARGET_PLATFORM_NAME}/libicutu.a)

if you link icu with static library, may be the linked order matters, try this:

  list(APPEND ICU_LINK_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/../third_party/icu4c/lib/${TARGET_PLATFORM_NAME}/libicui18n.a)
  list(APPEND ICU_LINK_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/../third_party/icu4c/lib/${TARGET_PLATFORM_NAME}/libicuuc.a)
  list(APPEND ICU_LINK_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/../third_party/icu4c/lib/${TARGET_PLATFORM_NAME}/libicudata.a)
  list(APPEND ICU_LINK_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/../third_party/icu4c/lib/${TARGET_PLATFORM_NAME}/libicuio.a)
  list(APPEND ICU_LINK_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/../third_party/icu4c/lib/${TARGET_PLATFORM_NAME}/libicutu.a)
听闻余生 2025-02-12 18:32:53

显然,您缺少 ICU-DevTools 包装。用命令安装

sudo apt get install icu-devtools

Aparently you missing icu-devtools package. Install that with command

sudo apt get install icu-devtools
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文