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 6341417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:01:48+00:00 2026-05-24T20:01:48+00:00

I try to link libraries in my program using firebreath framework. So I add

  • 0

I try to link libraries in my program using firebreath framework.

So I add this code in projectDef.cmake.

include_directories(/usr/include/giblib)
include_directories(/usr/include/X11)

add_library(giblib_ptm STATIC IMPORTED) 
set_property(TARGET giblib_ptm PROPERTY IMPORTED_LOCATION /usr/lib/libgiblib.a)

add_library(X11_ptm STATIC IMPORTED) 
set_property(TARGET X11_ptm PROPERTY IMPORTED_LOCATION /usr/lib/i386-linux-gnu/libX11.a)

add_library(Imlib_ptm STATIC IMPORTED) 
set_property(TARGET Imlib_ptm PROPERTY IMPORTED_LOCATION /usr/lib/libImlib2.a)

target_link_libraries(Printmade2 giblib_ptm X11_ptm Imlib_ptm)

Why I add ‘include_directories’ is I include header file in my .cpp file.

#include <giblib.h>
#include <Xlib.h>

After execute make, this error message appears.

/usr/lib/i386-linux-gnu/libX11.a(OpenDis.o): In function `OutOfMemory':
(.text+0x459): undefined reference to `xcb_disconnect'
/usr/lib/i386-linux-gnu/libX11.a(OpenDis.o): In function `XOpenDisplay':
(.text+0x8f5): undefined reference to `xcb_get_setup'
/usr/lib/i386-linux-gnu/libX11.a(OpenDis.o): In function `XOpenDisplay':
(.text+0xedb): undefined reference to `xcb_get_maximum_request_length'
/usr/lib/i386-linux-gnu/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x176): undefined reference to `xcb_parse_display'
/usr/lib/i386-linux-gnu/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x1d7): undefined reference to `xcb_connect_to_display_with_auth_info'
...
/usr/lib/i386-linux-gnu/libX11.a(xcb_io.o): In function `poll_for_event':
(.text+0x30e): undefined reference to `xcb_poll_for_event'
/usr/lib/i386-linux-gnu/libX11.a(xcb_io.o): In function `poll_for_response':
(.text+0x6b4): undefined reference to `xcb_poll_for_reply'
/usr/lib/i386-linux-gnu/libX11.a(xcb_io.o): In function `_XSend':
(.text+0x85f): undefined reference to `xcb_writev'
/usr/lib/i386-linux-gnu/libX11.a(xcb_io.o): In function `_XReadEvents':
(.text+0xa1f): undefined reference to `xcb_connection_has_error'
....

I think this error is cause by ‘add_library’ and ‘set_property’,

but I can’t understand why.

What should I do for linking static libraries in my program?

  • 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-05-24T20:01:50+00:00Added an answer on May 24, 2026 at 8:01 pm

    I think you are misunderstanding the creation of a static library. A static library is a collection of object files, it does not have any init/deinit code to pull in additional libraries like a shared library or an executable can.

    If you create a libraryA that uses code from libraryB and libraryC when you build applicationX that uses libraryA you must manually pull in both libraryB and libraryC. With shared libraries this is not necessary.

    If you investigate pkg-config you can see the property Libs.private that specifies these additional private or internal libraries that a static link would require.

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

Sidebar

Related Questions

please try this link for getting my code. its working in all browsers not
I try to use this code for toggling text on the link: var showText=<span>Open</span>
I'm using tomcat 6.0 and struts2. When I try to click on a link
I have this site and I try to add a contact form in jQuery
I try to realize a link (in fact many links) that update a table
i try to embed a link to an external website into a pdf-file, generated
I try to compile and link my application in 2 steps : Compiling: g++
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
Try the following code public enum Color { Blue=1, Red=2, Green=3 } public List<Color>
actually i create a CMake script to localize the DevIL library using MSYS/MinGW on

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.