Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7753597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:05:34+00:00 2026-06-01T12:05:34+00:00

So I’m compiling the examples for libgstreamermm-0.10, and I’ve run into an issue with

  • 0

So I’m compiling the examples for libgstreamermm-0.10, and I’ve run into an issue with CMake.

With the version of libgstreamermm-0.10 that is installed by default on my system, the example segfaults. OK, so I got the latest sources and installed them to /usr/local and get the new example. Everything’s looking good.

g++ main.cc player_window.cc -o test `pkg-config --cflags --libs gtkmm-3.0` `pkg-config --cflags --libs gstreamermm-0.10`

works fine and as expected. Great, now to try and get it to play nicely with CMake. I make a quick CMakeLists.txt file. I use pkg-config, as that worked fine and I don’t really want to add a find module. So my file looks like this:

cmake_minimum_required(VERSION 2.6.2)
project(media_player_gtkmm)

INCLUDE(FindPkgConfig)

set(SOURCES main.cc player_window.cc)

add_executable(media_player_gtkmm ${SOURCES})

#dependencies
pkg_check_modules(GSTMM REQUIRED gstreamermm-0.10)
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0)
include_directories(${GTKMM_INCLUDE_DIRS} ${GSTMM_INCLUDE_DIRS})
link_directories(${GTKMM_LIBRARY_DIRS} ${GSTMM_LIBRARY_DIRS})
target_link_libraries(media_player_gtkmm ${GTKMM_LIBRARIES} ${GSTMM_LIBRARIES})

Everything compiles until the link stage, where I get undefined symbol errors. I then see the output of pkg-config --libs gstreamermm-0.10 starts with -L/usr/local/lib. I look at the output of make VERBOSE=1 and CMake is NOT adding the -L to the link command, even though I have the link_directories line. So even though I’m using the headers for the new version of gstreamer in /usr/local/include, the library from /usr/lib is being used instead, when I want the version in /usr/local/lib to be used. Pkg-Config seems to pick up on this, and adjusts accordingly, but CMake, even though I have it using pkg-config internally, doesn’t pick up on the link flags.

I could manually set the link flags for now, but that seems like a bit of a hack. I’m sure there’s a better way to specify this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:05:35+00:00Added an answer on June 1, 2026 at 12:05 pm

    link_directories only affects targets that come AFTER it. So, you need
    to move your add_executable to be after the link_directories call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.