cmake出错了
wwhwwxlz opened this issue · 5 comments
/opt/aarch64/KPGCC/gcc-10.3.1-2023.12-aarch64-linux/bin/../lib64/gcc/aarch64-linux-gnu/10.3.1/../../../../aarch64-linux-gnu/bin/ld: ../lib/libexiv2.so.0.28.2: undefined reference to ini_parse_string' /opt/aarch64/KPGCC/gcc-10.3.1-2023.12-aarch64-linux/bin/../lib64/gcc/aarch64-linux-gnu/10.3.1/../../../../aarch64-linux-gnu/bin/ld: ../lib/libexiv2.so.0.28.2: undefined reference to
ini_parse'
cmake 3.25.0
It would seem you're missing libinih (or the correct path to it). You should be seeing something like this example during CMake configuration (from Debian experimental build log):
-- Found inih: /usr/lib/aarch64-linux-gnu/libinih.so
-- inih_INCLUDE_DIRS : /usr/include
-- inih_LIBRARIES : /usr/lib/aarch64-linux-gnu/libinih.so
-- inih_inireader_INCLUDE_DIRS : /usr/include
-- inih_inireader_LIBRARIES : /usr/lib/aarch64-linux-gnu/libINIReader.so
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/home/vcpkg-2023.08.09/scripts/buildsystems/vcpkg.cmake ..
-- Found inih: /home/vcpkg-2023.08.09/installed/arm64-linux/lib/libinih.a
-- inih_INCLUDE_DIRS : /home/vcpkg-2023.08.09/installed/arm64-linux/include
-- inih_LIBRARIES : /home/vcpkg-2023.08.09/installed/arm64-linux/lib/libinih.a
-- inih_inireader_INCLUDE_DIRS : /home/vcpkg-2023.08.09/installed/arm64-linux/include
-- inih_inireader_LIBRARIES : /home/vcpkg-2023.08.09/installed/arm64-linux/lib/libINIReader.a
So, that path /home/vcpkg-2023.08.09/installed/arm64-linux
doesn't appear in the above ld
command. Something is up w/ your toolchain definitions, and I don't think this is an exi2 bug per se.
我换了低版本的没有报错了
--- src/CMakeLists.txt.bak 2024-08-09 20:38:36
+++ src/CMakeLists.txt 2024-08-09 20:39:02
@@ -258,10 +258,10 @@
endif()
if( EXIV2_ENABLE_INIH )
- target_link_libraries( exiv2lib_int PRIVATE inih::libinih )
target_link_libraries( exiv2lib_int PRIVATE inih::inireader )
- target_link_libraries( exiv2lib PRIVATE inih::libinih )
+ target_link_libraries( exiv2lib_int PRIVATE inih::libinih )
target_link_libraries( exiv2lib PRIVATE inih::inireader )
+ target_link_libraries( exiv2lib PRIVATE inih::libinih )
list(APPEND requires_private_list "INIReader")
endif()