-
Notifications
You must be signed in to change notification settings - Fork 282
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
Build is using incorrect include path #1516
Comments
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8146ef7..d6930ee4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,7 +73,7 @@ endif()
include_directories(${CMAKE_BINARY_DIR}) # Make the exv_conf.h file visible for the full project
-
+include_directories( BEFORE SYSTEM include) # for #include <exiv2/exiv2>
if( EXIV2_ENABLE_XMP )
add_subdirectory( xmpsdk )
endif() |
See discussion #1520 which I have closed. I have to find proof of a fault before submitting a PR for this. |
Compiling geotag.cpp reads /usr/local/include/exv_conf.h 1666 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance $ git checkout 0.27-maintenance ; git pull --rebase
Already on '0.27-maintenance'
Your branch is up to date with 'origin/0.27-maintenance'.
...
1667 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance $ cd build
1668 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance/build $ cd .. ; rm -rf build ; mkdir build ; cd build
1669 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance/build $ cmake .. '-DCMAKE_CXX_FLAGS=-H' ; make 2>&1 | grep exv_conf
-- The CXX compiler identification is AppleClang 12.0.0.12000032
...
-- CMAKE_CXX_STANDARD:
-- --- Compiler flags ---
-- General: -H
-fstack-protector-strong
-Wp,-D_GLIBCXX_ASSERTIONS
-Wall
-Wcast-align
-Wpointer-arith
-Wformat-security
-Wmissing-format-attribute
-Woverloaded-virtual
-W
-- Extra:
...
-- Generating done
-- Build files have been written to: /Users/rmills/gnu/github/exiv2/0.27-maintenance/build
... /Users/rmills/gnu/github/exiv2/0.27-maintenance/build/exv_conf.h
... /Users/rmills/gnu/github/exiv2/0.27-maintenance/build/exv_conf.h
....
... /usr/local/include/exiv2/exv_conf.h
1670 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance/build $ |
The patch for geotag.cpp is: From 89874638483f3d16e405df0ce355fafd3e36baa5 Mon Sep 17 00:00:00 2001
From: Robin Mills <robin@clanmills.com>
Date: Sun, 4 Apr 2021 19:49:07 +0100
Subject: [PATCH] geotag is incorrectly reading /usr/local/include/exiv2.hpp
---
samples/CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt
index 2639335264..b7b1cd7ec3 100644
--- a/samples/CMakeLists.txt
+++ b/samples/CMakeLists.txt
@@ -79,6 +79,8 @@ if( EXPAT_FOUND )
exiv2-xmp
${EXPAT_LIBRARIES}
)
+ target_include_directories(geotag PRIVATE ${CMAKE_BINARY_DIR}) # exv_conf.h
+ target_include_directories(geotag PRIVATE include) # for #include <exiv2/exiv2.hpp>
target_include_directories(geotag PRIVATE ${EXPAT_INCLUDE_DIR})
target_include_directories(geotag PRIVATE ${CMAKE_SOURCE_DIR}/src) # To find unused.h I'm going to "let this go" and not submit a change. |
There is something HORRIBLY WRONG when the machine isn't clean. The test suite can fail on Ubuntu. We can get linking errors. I'd like to see this totally understood and solved for v1.00. |
The linkage error is at run-time concerning the symbol _ZN5Exiv217exposureBiasValueERKNS_8ExifDataE which is in the library: 541 rmills@rmillsmm-ubuntu:~/gnu/github/exiv2/0.27-maintenance/build $ c++filt _ZN5Exiv217exposureBiasValueERKNS_8ExifDataE
Exiv2::exposureBiasValue(Exiv2::ExifData const&)
542 rmills@rmillsmm-ubuntu:~/gnu/github/exiv2/0.27-maintenance/build $ nm lib/libexiv2.so.27 | grep _ZN5Exiv217exposureBiasValueERKNS_8ExifDataE
0000000000136596 T _ZN5Exiv217exposureBiasValueERKNS_8ExifDataE
543 rmills@rmillsmm-ubuntu:~/gnu/github/exiv2/0.27-maintenance/build $ The following is typical: ======================================================================
ERROR: crw_test (testcases.TestCases)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/rmills/gnu/github/exiv2/buildserver/tests/bash_tests/testcases.py", line 266, in crw_test
out += BT.Executer('exiv2 -v -pt {crwfile}', vars())
File "/home/rmills/gnu/github/exiv2/buildserver/tests/bash_tests/utils.py", line 471, in __init__
self.run()
File "/home/rmills/gnu/github/exiv2/buildserver/tests/bash_tests/utils.py", line 509, in run
raise RuntimeError('\n' + log.to_str())
RuntimeError:
[INFO] #1 Add and modify tags
[ERROR] Failed to execute: ['/home/rmills/gnu/github/exiv2/buildserver/build/bin/exiv2', '-v', '-pt', 'exiv2-canon-powershot-s40.crw']
[ERROR] The asserted return code is [0], but got 127
[INFO] OUTPUT:
/home/rmills/gnu/github/exiv2/buildserver/build/bin/exiv2: symbol lookup error: /home/rmills/gnu/github/exiv2/buildserver/build/bin/exiv2: undefined symbol: _ZN5Exiv217exposureBiasValueERKNS_8ExifDataE There's something wrong. We're using the wrong library at run time or something like that. |
I've been aware for some time that there's something wrong with the path to the include files. I first noticed it when I shipped v0.27.3. The following day somebody reported something similar #1240 I investigated without success.
The build uses /usr/local/include/exiv2/exiv2.hpp. It should use <builddir>/include/exiv2/exiv2.hpp
The text was updated successfully, but these errors were encountered: