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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:02:14+00:00 2026-05-22T20:02:14+00:00

My product is a C++ library, which, on Windows, is distributed as a dll.

  • 0

My product is a C++ library, which, on Windows, is distributed as a dll. It makes very little use of the c-runtime (basic iostream and that’s it), so I’m sure that all recent versions of the CRT will be fine.

Since my client is supposed to build his application using my dll, I don’t want to impose upon him any specific runtime version. I’d like my dll to bind to whatever runtime library version my client’s app is using (and I can assume that he’ll use dynamic linking for his CRT). After all, isn’t that what dynamic linking is all about? Is that possible?

EDIT: linking the dll against the static runtime libs won’t work either, because then the static runtime (from the dll) and the dynamic runtime (from the client’s application) will be mixed, which is bad.

EDIT: What I’m mainly asking is how do I tell the runtime loader to link my dll against whatever CRT the application is linked with? Something with the manifest, perhaps?
More generally, my question is how to build a nicely-behaving dll, that’s to be used by clients building they’re own applications?

EDIT: Thanks to the advice in the answers, I’ve transferred all references to std classes into inlined functions in my headers, and linked my dll with the static runtime libraries. It now seems to work even in applications linked with different CRT versions.

  • 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-22T20:02:15+00:00Added an answer on May 22, 2026 at 8:02 pm

    There’s no real way to ensure your DLL works with multiple runtimes — any of the types that change between them can lead to incompatibilities. For instance, the size of an object can change, or the location of members in them. There is very little room in C++ for this kind of thing.

    The best thing you can do is statically link to the runtime and ensure the exported API is limited to types strictly under your control — no passing std::string to a function, no stdlib types as members, and don’t new in one DLL and delete in another. Don’t mix inline and exported functions (including constructors/destructors) for the same object, because member order and padding might change between compilers. The pimpl idiom might help here.

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

Sidebar

Related Questions

Suppose your for-sale software product uses some free open-source library at runtime. Therefore, you
I've a FreeMarker library that I want to ship with my product, and I'm
My product has several components: ASP.NET, Windows Forms App and Windows Service. 95% or
A product that I am working on collects several thousand readings a day and
Our product contains a task-manager system that allows applications to run code in a
I have a product, X, which we deliver to a client, C every month,
I have a product which has been traditionally shipped as an MSI file. It
Do you know of any .NET library which can decode several types of audio
Any recommendations for an open source (free) C# library/application for a C# Windows Application
Is there a good BarCode scan capability or library for Windows Phone 7? I

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.