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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:39:16+00:00 2026-05-31T03:39:16+00:00

I have a main task (to develop a library) that I split up to

  • 0

I have a main task (to develop a library) that I split up to get it more manageable.
Basically I have a template class for vectors and matrices, several classes that use these two, the main library that uses all of these classes and a Demo application that uses the library to display the features and test them.

The demo application is a Qt/cdt project.
The library is a pure cdt project.
The vector and matrix class are one cdt project.
Each of the other classes have an own cdt project.

Now I am mainly developing the library and want to see the results in the demo application. So the main development cycle is to change the source of the library and recompile the demo application.

My problem is: How to setup the projects builds to have only to rebuild the files necessary and link them accordingly.

My first approach was to include all the source files of all projects (including the library) in the demo application. That worked but did not trigger on updated files in the library (so I head to clean and build everything again each time).

After this I thought of building the library statically and then linking it into the source file, while referencing the projects. This triggered recompilation at the right place but it seems that the new binary files were not linked into the executable.

Basically the question is: How should I arrange all those files to have a clear layout (not everything in one project), build the right things (and not everything) if necessary and link them into the executable (in case there were changes).

Side note Another problem with project referencing was, that the template classes were compiled in their project which led to distracting error messages.

Edit To give a better understanding of the directory layout:

eclipse_workspace/
    demo_application/
       .cproject
       .project
       main.cpp
       somewidget.h
       somewidget.cpp
       demo_application.pro
       ...
    main_library/
       .cproject
       .project
       class1_header.h
       class1_implementation.cpp
       class2_header.h
       class2_implementation.cpp
       ...
    .../
    vector_matrix/
       .cproject
       .project
       vector.h
       vector.cpp
       matrix.h
       matrix.cpp
       ...

Each project depends on the projects beneath it.

  • 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-31T03:39:17+00:00Added an answer on May 31, 2026 at 3:39 am

    Finally I found the solution after finding the right words to search for. The main problem was that the QMake created Makefiles did not check for the “static” library as a dependency of the target. I solved this by adding

    PRE_TARGETDEPS += "path/to/my/libRary.a"
    

    To the project file. With that the binary gets relinked, when there were changes in the library.

    Additionally I setup each project in eclipse to reference the dependent projects (Project properties -> Project References) to trigger rebuilds if necessary.

    Furthermore I got rid of the ugly error messages from my template project by setting up the build correctly (I had a main.cpp to show some example usage of the template, so building was nice). The problem was, that the .cpp files of the template classes were in the build too so they were compiled twice, which gave the errors (previous declaration of … on line [exact same line]). I solved this by excluding all those template files from the build.

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

Sidebar

Related Questions

I have a main table that I must get data from. I have a
I have a main thread that contains my WPF GUI and one or more
I have main table called 'Employee' and another slave table called 'EmployeeTypes' that has
I have a main activity that takes elements from a database and displays them
So here is the story. I have this device that uses Linux and more
I have a main class filled with a cursor adapter: public class MainMenu extends
I have a main activity that launches a child activity using the following code:
I'm going to develop a website whose main task is to integrate wikis, forums,
I would like to develop a UI that includes draggable windows, a task bar
I have application with lots of views. My main task is to hide uittabar

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.