You are not logged in.

#1 2023-04-08 10:38:12

rtw0
Member
Registered: 2023-04-02
Posts: 27

[SOLVED] ld complains about undefined reference to `gpgme_*'

Hello, everyone!

I've been encountering problems with gpgme each time I try to build libzypp (or any other package that requires gpgme). After some tweaking suggested by the AUR community (thanks again loqs!), the build process runs smooth until ld complains about undefined references in /zypp/libzypp.so.1722.8.0. Here is an extract from the bug report.

/usr/bin/ld: ../zypp/libzypp.so.1722.8.0: undefined reference to `gpgme_op_delete'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.0: undefined reference to `gpgme_op_keylist_next'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.0: undefined reference to
/usr/bin/ld: ../zypp/libzypp.so.1722.8.0: undefined reference to `gpgme_op_import_result'

What can I do to solve that problem?

Cheers,
rtw0

Last edited by rtw0 (2023-04-09 14:37:33)

Offline

#2 2023-04-08 14:57:37

seth
Member
Registered: 2012-09-03
Posts: 52,428

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

or any other package that requires gpgme

Name one. All I see is you trying to build this package.

What can I do to solve that problem?

Start by posting not

an extract from the bug report

but the entire build log.
libgpgme.so is probably not in the list of objects to link.

Offline

#3 2023-04-08 15:23:41

loqs
Member
Registered: 2014-03-06
Posts: 17,616

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

Did you make the change to zypp/CMakeLists.txt from https://bbs.archlinux.org/viewtopic.php … 5#p2093255 ?

Offline

#4 2023-04-08 16:24:29

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

Yes, loqs I did make the changes you mention.

Thanks seth, I'll try what you suggest.

Yet, if you know of any documentation that provides instructions for adding an .so file to the list of files to link, I'm up for it.

In the meantime, I'll try on my own, but help would be welcome.

Cheers,
rtw0

Offline

#5 2023-04-08 16:26:50

loqs
Member
Registered: 2014-03-06
Posts: 17,616

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

Please post the full diff of changes you have made to the source compared to the extracted tarball.

Offline

#6 2023-04-08 17:06:57

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

That's my diff after the changes. Note that it doesn't include patch.test as in your diff, because I make the changes manually.

diff --git a/PKGBUILD b/PKGBUILD
index dfbbd21..ee03029 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@

pkgbase=libzypp
pkgname=(libzypp libzypp-doc)
-pkgver=17.30.0
+pkgver=17.30.3
pkgrel=1
pkgdesc="ZYpp Package Management library"
arch=('x86_64')
@@ -29,8 +29,9 @@ makedepends=(
   'gnupg'
   'graphviz'
)
-source=("${pkgname}-${pkgver}::https://github.com/openSUSE/${pkgname}/archive/${pkgver}.tar.gz")
-sha256sums=('3410a4cf7a40467c544ad221f3116aab6ba198b27a9c150116c93b5950f74815')
+source=("${pkgname}-${pkgver}::https://github.com/openSUSE/${pkgname}/archive/${pkgver}.tar.gz)
+sha256sums=('5aa6305c492df46c13164da6e5b44dedb2271666c8e85efc808abf48d2130bf1'
+            '02b729f5c1faf2791f34c1392d4fe170b1a9d6b4d2a8c1264075cf555438bb83')

build() {
   cmake \

Offline

#7 2023-04-08 17:39:13

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

Hi seth,

Here's the full bug report after building :

[ 65%] Linking CXX executable ProvideSignedDirectory
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_delete'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_next'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_stream'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_get_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_end'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_file'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_key_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_armor'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_start'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_pubkey_algo_name'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_get_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_set_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_seek'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strerror'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_read'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_check_version_internal'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strsource'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_mem'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_protocol'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_export_keys'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/CMakeFiles/ProvideSignedDirectory.dir/build.make:118: tools/ProvideSignedDirectory] Error 1
make[1]: *** [CMakeFiles/Makefile2:1844: tools/CMakeFiles/ProvideSignedDirectory.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 66%] Linking CXX executable DumpSelectable
[ 66%] Built target zypp-allsym
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_delete'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_next'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_stream'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_get_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_end'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_file'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_key_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_armor'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_start'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_pubkey_algo_name'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_get_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_set_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_seek'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strerror'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_read'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_check_version_internal'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strsource'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_mem'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_protocol'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_export_keys'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/CMakeFiles/DumpSelectable.dir/build.make:118: tools/DumpSelectable] Error 1
make[1]: *** [CMakeFiles/Makefile2:1814: tools/CMakeFiles/DumpSelectable.dir/all] Error 2
[ 67%] Linking CXX executable DiskUsageCounter
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_delete'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_next'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_stream'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_get_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_end'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_file'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_key_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_armor'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_start'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_pubkey_algo_name'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_get_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_set_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_seek'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strerror'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_read'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_check_version_internal'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strsource'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_mem'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_protocol'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_export_keys'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/CMakeFiles/DiskUsageCounter.dir/build.make:118: tools/DiskUsageCounter] Error 1
make[1]: *** [CMakeFiles/Makefile2:1784: tools/CMakeFiles/DiskUsageCounter.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Offline

#8 2023-04-08 19:46:52

loqs
Member
Registered: 2014-03-06
Posts: 17,616

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

loqs wrote:

Please post the full diff of changes you have made to the source compared to the extracted tarball.

$ cd libzypp/
$ mv src src.editted
$ makepkg -Codd --noprepare
$ diff -r src src.editted/

Offline

#9 2023-04-08 19:47:25

seth
Member
Registered: 2012-09-03
Posts: 52,428

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

Please use [code][/code] tags, not "quote" tags. Edit your post in this regard.

seth wrote:

Start by posting … the entire build log.

There is nothing such as a "bug report" here, there's some compiler/build system output and it will tell you what's going on - especially/likely if you're exporting VERBOSE=1
That output there only tells that the linker can't resolve some symbols and it *looks* like it's not linking libgpgme.
Whether that's the case and more importantly: why is not part of that output at all. There's likely a previous cmake error/warning?

The only thing I can tell you based on that is to fix the build configuration.

Offline

#10 2023-04-09 06:36:32

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

The output of

$ cd libzypp/
$ mv src src.editted
$ makepkg -Codd --noprepare
$ diff -r src src.editted/

Only in src.editted: build
diff -r src/libzypp-17.30.3/CMakeLists.txt src.editted/libzypp-17.30.3/CMakeLists.txt
248,254c248,256
< FIND_PACKAGE(Gpgme REQUIRED)
< IF ( NOT GPGME_PTHREAD_FOUND )
<   MESSAGE( FATAL_ERROR " gpgme not found" )
< ELSE()
<   INCLUDE_DIRECTORIES( ${GPGME_INCLUDES} )
<   LINK_DIRECTORIES(${GPGME_LIBRARY_DIR})
< ENDIF()
---
> #FIND_PACKAGE(Gpgme REQUIRED)
> #IF ( NOT GPGME_PTHREAD_FOUND )
> # MESSAGE( FATAL_ERROR " gpgme not found" )
> #ELSE()
> #INCLUDE_DIRECTORIES( ${GPGME_INCLUDES} )
> #LINK_DIRECTORIES(${GPGME_LIBRARY_DIR})
> #ENDIF()
> PKG_CHECK_MODULES (GPGME gpgme REQUIRED)

Offline

#11 2023-04-09 06:49:13

loqs
Member
Registered: 2014-03-06
Posts: 17,616

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

The diff shows you have only modified CMakeLists.txt you need to modifiy zypp/CMakeLists.txt as well,  as I mentioned in post #3.

Offline

#12 2023-04-09 07:01:49

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

The CMake warning after running makepkg:

[rtw0@archlinux libzypp]$ makepkg
==> Making package: libzypp 17.30.3-1 (Sun 09 Apr 2023 08:46:41 AM CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found libzypp-17.30.3
==> Validating source files with sha256sums...
    libzypp-17.30.3 ... Passed
==> Extracting sources...
rm: cannot remove '/home/rtw0/chroot/libzypp/src/libzypp-17.30.3': Is a directory
ln: failed to create symbolic link '/home/rtw0/chroot/libzypp/src/libzypp-17.30.3': File exists
==> Removing existing $pkgdir/ directory...
==> Starting build()...
-- Libraries will be installed in /usr/lib
-- Header files will be installed in /usr/include
-- Config files will be installed in /etc
** Manual files will be installed in /usr/share/man
Using zypp-rpm from path: /usr/lib/zypp/zypp-rpm
-- Building for SUSE
CMake Warning at CMakeLists.txt:60 (find_package):
  By not providing "FindFindPkgConfig.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "FindPkgConfig", but CMake did not find one.

  Could not find a package configuration file provided by "FindPkgConfig"
  with any of the following names:

    FindPkgConfigConfig.cmake
    findpkgconfig-config.cmake

  Add the installation prefix of "FindPkgConfig" to CMAKE_PREFIX_PATH or set
  "FindPkgConfig_DIR" to a directory containing one of the above files.  If
  "FindPkgConfig" provides a separate development package or SDK, be sure it
  has been installed.


-- Writing spec file...
-- I hate you rpm-lint...!!!
CMake Warning at /usr/share/cmake/Modules/CPack.cmake:507 (message):
  CPack.cmake has already been included!!
Call Stack (most recent call first):
  CMakeLists.txt:121 (INCLUDE)


-- rpm found: includes in /usr/include, library in /usr/lib/librpm.so, librpmio in /usr/lib/librpmio.so (suspect 4.x)
-- Detected RPM version is: maj:4  min:18 patch:1

-- boost found: includes in /usr/include, library in /usr/lib
-- Found Gettext: 
CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args`
  (LibSolv_ext) does not match the name of the calling package (LibSolv).
  This can lead to problems in calling code that expects `find_package`
  result variables (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindLibSolv.cmake:76 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:237 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found LibSolv: /usr/include /usr/lib/libsolv.so;/usr/lib/libsolvext.so
CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (libproxy).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  cmake/modules/Findlibproxy.cmake:5 (INCLUDE)
  CMakeLists.txt:270 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- doxygen found: /usr/bin/doxygen
Building with zstd support enabled.
-- soname: 1722.8.3
-- version: 17.30.3
-- Writing pkg-config file...
-- FindZypp.cmake will be installed in /usr/share/cmake/Modules
-- zypp.conf will be installed in /etc/zypp
-- needreboot will be installed in /etc/zypp/
-- systemCheck will be installed in /etc/zypp
/home/rtw0/chroot/libzypp/src/libzypp-17.30.3/zypp-core
ADDING lib zypp to project
ADDING lib zypp-allsym to project
-- rpm found: includes in /usr/include, library in /usr/lib/librpm.so, librpmio in /usr/lib/librpmio.so (suspect 4.x)
-- Detected RPM version is: maj:4  min:18 patch:1

a2x found: /usr/bin/a2x
asciidoctor found: /usr/bin/asciidoctor
-- Configuring done (0.8s)
-- Generating done (0.6s)
-- Build files have been written to: /home/rtw0/chroot/libzypp/src/build
[  0%] Built target locks.5_Target
[  0%] Built target zypp-CheckAccessDeleted.1_Target
[  0%] Built target zypp-NameReqPrv.1_Target
[  3%] Built target zypp-protobuf
[  3%] Built target doc
[  3%] .pot file diff...
[ 14%] Built target translations
[ 15%] Built target zypp-media
[ 16%] Built target zyppng-objlib
[ 20%] Built target zypp-curl
[ 30%] Built target zypp-core
[ 31%] Built target zypp-rpm
[ 65%] Built target zypp-objlib
[ 65%] Built target zypp
[ 65%] Built target zypp-allsym
[ 66%] Linking CXX executable ProvideSignedDirectory
[ 66%] Linking CXX executable DumpSelectable
[ 67%] Linking CXX executable DiskUsageCounter
[ 67%] Linking CXX executable ToolScanRepos

And the complain about undefined reference

[ 67%] Linking CXX executable ToolScanRepos
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_delete'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_next'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_stream'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_get_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_end'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_file'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_key_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_armor'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_start'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_pubkey_algo_name'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_get_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_set_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_seek'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strerror'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_read'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_check_version_internal'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strsource'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_mem'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_protocol'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_export_keys'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/CMakeFiles/ProvideSignedDirectory.dir/build.make:118: tools/ProvideSignedDirectory] Error 1
make[1]: *** [CMakeFiles/Makefile2:1844: tools/CMakeFiles/ProvideSignedDirectory.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_delete'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_next'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_stream'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_get_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_end'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_file'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_key_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_armor'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_start'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_pubkey_algo_name'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_get_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_set_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_seek'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strerror'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_read'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_check_version_internal'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strsource'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_mem'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_protocol'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_export_keys'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_delete'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_next'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_stream'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_get_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_end'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_file'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_key_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_armor'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_start'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_pubkey_algo_name'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_get_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_set_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_seek'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strerror'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_read'
collect2: error: ld returned 1 exit status
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_check_version_internal'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strsource'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_mem'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_protocol'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_release'
make[2]: *** [tools/CMakeFiles/DumpSelectable.dir/build.make:118: tools/DumpSelectable] Error 1
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_export_keys'
make[1]: *** [CMakeFiles/Makefile2:1814: tools/CMakeFiles/DumpSelectable.dir/all] Error 2
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_delete'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_next'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_stream'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_get_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_end'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_file'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_key_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_verify_result'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_armor'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_keylist_start'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_pubkey_algo_name'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_new'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_get_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_keylist_mode'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_ctx_set_engine_info'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_seek'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strerror'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_read'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_check_version_internal'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_strsource'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_new_from_mem'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_protocol'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_release'
collect2: error: ld returned 1 exit status
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_export_keys'
make[2]: *** [tools/CMakeFiles/ToolScanRepos.dir/build.make:118: tools/ToolScanRepos] Error 1
make[1]: *** [CMakeFiles/Makefile2:1874: tools/CMakeFiles/ToolScanRepos.dir/all] Error 2
collect2: error: ld returned 1 exit status
make[2]: *** [tools/CMakeFiles/DiskUsageCounter.dir/build.make:118: tools/DiskUsageCounter] Error 1
make[1]: *** [CMakeFiles/Makefile2:1784: tools/CMakeFiles/DiskUsageCounter.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Offline

#13 2023-04-09 07:42:21

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

diff -r src src.editted after the changes made to zypp/CMakeLists.txt

Only in src.editted/: build
diff -r src/libzypp-17.30.3/CMakeLists.txt src.editted/libzypp-17.30.3/CMakeLists.txt
248,254c248,256
< FIND_PACKAGE(Gpgme REQUIRED)
< IF ( NOT GPGME_PTHREAD_FOUND )
<   MESSAGE( FATAL_ERROR " gpgme not found" )
< ELSE()
<   INCLUDE_DIRECTORIES( ${GPGME_INCLUDES} )
<   LINK_DIRECTORIES(${GPGME_LIBRARY_DIR})
< ENDIF()
---
> #FIND_PACKAGE(Gpgme REQUIRED)
> #IF ( NOT GPGME_PTHREAD_FOUND )
> #  MESSAGE( FATAL_ERROR " gpgme not found" )
> #ELSE()
> #  INCLUDE_DIRECTORIES( ${GPGME_INCLUDES} )
> #  LINK_DIRECTORIES(${GPGME_LIBRARY_DIR})
> #ENDIF()
> 
> PKG_CHECK_MODULES (GPGME gpgme REQUIRED)
diff -r src/libzypp-17.30.3/zypp/CMakeLists.txt src.editted/libzypp-17.30.3/zypp/CMakeLists.txt
915c915
<   TARGET_LINK_LIBRARIES(${LIBNAME} ${GPGME_PTHREAD_LIBRARIES})
---
>   TARGET_LINK_LIBRARIES(${LIBNAME} ${PKG_CHECK_MODULES})

And same complain about undefined reference

/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_set_protocol'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_import'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_data_release'
/usr/bin/ld: ../zypp/libzypp.so.1722.8.3: undefined reference to `gpgme_op_export_keys'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/CMakeFiles/DiskUsageCounter.dir/build.make:118: tools/DiskUsageCounter] Error 1
make[1]: *** [CMakeFiles/Makefile2:1784: tools/CMakeFiles/DiskUsageCounter.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Offline

#14 2023-04-09 07:48:40

loqs
Member
Registered: 2014-03-06
Posts: 17,616

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

<   TARGET_LINK_LIBRARIES(${LIBNAME} ${GPGME_PTHREAD_LIBRARIES})
---
>   TARGET_LINK_LIBRARIES(${LIBNAME} ${PKG_CHECK_MODULES})

compared with

-  TARGET_LINK_LIBRARIES(${LIBNAME} ${GPGME_PTHREAD_LIBRARIES})
+  TARGET_LINK_LIBRARIES(${LIBNAME} ${GPGME_LIBRARIES})

Offline

#15 2023-04-09 07:49:44

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

I'll try again with a more complete instruction

TARGET_LINK_LIBRARIES(${LIBNAME} ${PKG_CHECK_MODULES} (GPGME gpgme REQUIRED)

as a substitute to

TARGET_LINK_LIBRARIES(${LIBNAME} ${GPGME_PTHREAD_LIBRARIES})

in zypp/CMakeLists.txt

Offline

#16 2023-04-09 07:54:18

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

That one

TARGET_LINK_LIBRARIES(${LIBNAME} ${PKG_CHECK_MODULES} (GPGME gpgme REQUIRED)

fails too.

Offline

#17 2023-04-09 07:57:17

loqs
Member
Registered: 2014-03-06
Posts: 17,616

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

Why did you modify the line to be inserted?  In a patch file - means a line to be deleted + a line to be inserted.

Last edited by loqs (2023-04-09 07:58:31)

Offline

#18 2023-04-09 08:02:38

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

Changed from

TARGET_LINK_LIBRARIES(${LIBNAME} ${PKG_CHECK_MODULES} (GPGME gpgme REQUIRED)

to

TARGET_LINK_LIBRARIES(${LIBNAME} ${PKG_CHECK_MODULES} gpgme)

Build in good progress now. End of build report

==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...

  -> Compressing man and info pages...
==> Checking for packaging issues...
==> WARNING: Package contains reference to $srcdir
usr/share/doc/libzypp/libzypp.doxytag/libzypp.doxytag
==> Creating package "libzypp-doc"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: libzypp 17.30.3-1 (Sun 09 Apr 2023 10:01:35 AM CEST)

Offline

#19 2023-04-09 08:05:13

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

[rtw0@archlinux libzypp]$ ls
libzypp-17.30.3                        pkg       src.original
libzypp-17.30.3-1-x86_64.pkg.tar.zst   PKGBUILD
libzypp-doc-17.30.3-1-any.pkg.tar.zst  src

Offline

#20 2023-04-09 08:12:26

loqs
Member
Registered: 2014-03-06
Posts: 17,616

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

TARGET_LINK_LIBRARIES(${LIBNAME} ${PKG_CHECK_MODULES} gpgme)

Add to the target's link library list the variable PKG_CHECK_MODULES which I expect is unset and hard code in the name of the library gpgme ignoring the variable set by PKG_CHECK_MODULES (GPGME gpgme REQUIRED) earlier.

Offline

#21 2023-04-09 08:12:56

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

loqs wrote:

Why did you modify the line to be inserted?  In a patch file - means a line to be deleted + a line to be inserted.

I know but it was mistake of mine.
Now I have two tar.zst files in my libzypp directory.
Should I use pacman now to install libzypp?

Offline

#22 2023-04-09 08:19:49

loqs
Member
Registered: 2014-03-06
Posts: 17,616

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

You will need libzypp installed in order to use it to build / use zypp.

Offline

#23 2023-04-09 08:21:17

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

How do you do that?

Add to the target's link library list the variable PKG_CHECK_MODULES which I expect is unset and hard code in the name of the library gpgme ignoring the variable set by PKG_CHECK_MODULES (GPGME gpgme REQUIRED) earlier.

Offline

#24 2023-04-09 08:22:24

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

Now I'm building zypper as libzypp has been installed with pacman -U.

Offline

#25 2023-04-09 08:24:01

loqs
Member
Registered: 2014-03-06
Posts: 17,616

Re: [SOLVED] ld complains about undefined reference to `gpgme_*'

Just to note,  this entire thread could have been avoided if you had chosen to use the patch I provided.

Offline

Board footer

Powered by FluxBB