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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:45:43+00:00 2026-06-11T14:45:43+00:00

I have a following question about linking on Linux: Suppose I have a class

  • 0

I have a following question about linking on Linux:

Suppose I have a class Foo that uses Qt. To build this class I’d have to use qmake to generate Makefile.

Later on I want to use this class Foo for a Perl module, which is a shared library. However, to build it I have to use Perl’s MakeMaker to generate Makefile of it’s own.

The way I’m doing it right now is that I build class Foo as a static library, and when building Perl module’s shared library I’m linking it against Foo’s static library.

The problem is that when building Perl module’s shared library I have to link it against all those Qt libraries that Foo’s static library is linked against.

So the question is:

  1. Does this approach even make sense?!

  2. Is it possible to build Foo’s static library in a way that I wouldn’t have to specify all it’s dependencies when building the Perl module’s shared library? (Because it is somewhat hard to add all those dependencies to module’s Makefile)

  3. Would it be any different if Foo’s library was shared, not static?

  • 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-11T14:45:45+00:00Added an answer on June 11, 2026 at 2:45 pm

    1) You can’t link a static library against a shared library.

    2) You would not need to explicitly link against Foo‘s dependencies if Foo itself was a DSO

    3) You can easily modify the Makefile.PL LIBS section to add extra linker dependencies.

    4) Qt is a downright pain to link statically anyway. You’re better off just doing the whole dynamic shebang unless you have specific version dependencies and OS/platform limitations. Hint: Even if you do have a ‘static’ build of Qt, this ‘static’ build won’t include things which it might decides need to be present as loadable modules. Been there.

    5) I believe there’s a CPAN module (somewhat recent) which provides Qt4 bindings. I’ve never used it and don’t know its status, but it may be worth checking out.

    But your best bet is to make Foo a dynamic library.. everyone’s happy then.

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

Sidebar

Related Questions

I have this rather simple question about Scala. Given that i have to following
This is a question about k-means clustering algorithm. I have the following points and
a question about class design. Currently I have the following structure: abstract Base Repository
I have the following question about JPA: Can I save the order of the
I have a question about variable scope in TCL, I have the following code:
I might have pretty basic question about regex. I have the following regex, which
I have a question about the following regular expression: I want to match the
I have a question about the following code in TCL/EXPECT: expect { timeout {
I have a question about the following C code: void my_function() { int i1;
I have a question about the following code : #include <iostream> #include <ctime> int

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.