Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P poppler
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 656
    • Issues 656
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 42
    • Merge requests 42
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • poppler
  • poppler
  • Issues
  • #831

Closed
Open
Created Oct 10, 2019 by John Hein@jhfdgl

link error: /usr/bin/ld: cannot find -lgtk-3

When linking poppler-glib-demo, I get a linker error: /usr/bin/ld: cannot find -lgtk-3

The CMakeLists.txt file only pulls in the libraries (-lgtk-3, etc.) without the paths to the
libraries (-L).

Here's a patch that fixes it:

--- poppler-0.81.0/glib/demo/CMakeLists.txt.orig        2019-10-09 21:27:03 UTC
+++ poppler-0.81.0/glib/demo/CMakeLists.txt
@@ -24,6 +24,9 @@
   layers.c
   selections.c
   taggedstruct.c
 )
 poppler_add_test(poppler-glib-demo BUILD_GTK_TESTS ${poppler_glib_demo_SRCS})
-target_link_libraries(poppler-glib-demo ${CAIRO_LIBRARIES} poppler-glib ${GTK3_LIBRARIES})
+#target_link_libraries(poppler-glib-demo ${CAIRO_LIBRARIES} poppler-glib ${GTK3_LIBRARIES})
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0)
+target_link_libraries(poppler-glib-demo ${CAIRO_LIBRARIES} poppler-glib PkgConfig::GTK3)

Part of that could be applied to poppler-0.81.0/cmake/modules/FindGTK.cmake instead.

Note: hint for unintuitive cmake features obtained from a stackoverflow answer here: https://stackoverflow.com/questions/29191855/what-is-the-proper-way-to-use-pkg-config-from-cmake

Edited Oct 10, 2019 by John Hein
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking