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

  • Home
  • SEARCH
  • 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 252871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:42:51+00:00 2026-05-11T21:42:51+00:00

My C++ project is growing larger. We are also moving to using cmake for

  • 0

My C++ project is growing larger. We are also moving to using cmake for building now. I want to divide the application into libraries so that they can be linked for testing, preparing the application package, etc. Right now I would divide my code into libraries as follows:

  • core
  • GUI
  • utilities (these are used by core and other components)
  • io (xml parsing/outputing using print functions of classes in core)
  • tests (unit tests)
  • simulator (tests the core)

An alternative would be to divide based on the directory structure – one library for each directory. But from my past experience it leads to too many libraries and then library dependencies become tough to handle during linking.

Are there any best practices in this regard?

  • 1 1 Answer
  • 1 View
  • 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-11T21:42:51+00:00Added an answer on May 11, 2026 at 9:42 pm

    Sit down with a piece of paper and decide your library architecture.

    The library should be designed as a set of levels.

    • A libary on level A (the base) should have dependencioes only on system libraries and only if it must on libraries on level A.
    • A library on level B can have dependencies on libraries at level A and system libararies and only if it must on libraries on level B.
    • etc

    Each library should represent a complete job at its particular level. Things at lower level generally have smaller jobs but lots of them. A library at a higher level should reresent a complete task. ie don’t have a lib for windows objects and a lib for events. At this level the job here is handline all interaction with a window (this includes how it interacts with events).

    You seem to have identified some resonable functional groups. The only one that see a bit suspicious is io. If you truly have some generic IO routines that provide real functionality fine. But if it is just grouping the IO for a bunch of different objects then I would scrap that (it all depends on the usage).

    So the next step is to identify the relationship between them.

    As for using directory structures. Usually everything in one directory will be present within the same library, but that does not exclude the posability of other directories also being present. I would avoid putting half the classes in directory in libA and the other half of the classes in libB etc.

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

Sidebar

Related Questions

I have an ASP.NET application in VS2008 that is growing larger and am developing
My project consists of an app that links to two static libraries. Each of
I would like to divide my Qt project into several directories because it is
I am wondering how I should manage a growing C++ project. Now, I am
As the project I'm working on is growing, the number of tests is also
I have a ever growing project using StructureMap as the IOC container. I am
I'm going to refactor a growing project from using Castle Activerecord to pure NHibernate
The project that I am working on (Node.js) implies lots of operations with the
The project currently has a UIviewController called Dashboard that acts as the main view
This project is in Obj-C for iphone. I'm using the double float version of

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.