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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:56:38+00:00 2026-06-11T17:56:38+00:00

Is it possible to take a static library written in C++ and somehow integrate

  • 0

Is it possible to take a static library written in C++ and somehow integrate it into a .NET process in a way that the .NET process will be integrated with the lib into one exe file?
What I mean is that I know I can invoke a c++ DLL from within a C# process but the user will still have to have the C++ DLL, but is it possible to use a lib instead of a DLL?(this way the user won’t even know that the exe uses my library).
and if it is possible, how?

  • 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-11T17:56:39+00:00Added an answer on June 11, 2026 at 5:56 pm

    Unique among other managed languages, C++ allows for mixed mode – a combination of managed (C++/CLI) and native C++ within the same compilation unit (dll/exe/lib), with calls back and forth. Maybe you can leverage that, create a kind of a glue layer. I’ve never tried though.

    The key is the /clr compiler switch – you apply it to some files in the project but not others. Then you create some classes/functions as managed. The unmanaged bits can see them and call them, and vice versa. Passing primitive types around is done transparently, for strings there’s some marshaling trickery. I’ll be able to post more on Monday.

    EDIT: seems like some deep magic would be required. Not on the mixed C++ side – on the linking the result to C# side. The Visual Studio IDE does not readily support the scenario, you see. Chances are, the regular build process won’t be of any use.

    EDIT2: you can compile your C++ bits to a .netmodule by specifying a /LN command line option to the compiler and /NOASSEMBLY to a linker. Now, to link that to the C# exe…

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

Sidebar

Related Questions

Possible Duplicate: PHP take all combinations I'm thinking of making something in PHP that
I'm writing a library in C# that I will later use for an application,
I'm trying to create an overload of the System.Console.ReadLine() method that will take a
I'm trying to create an overload of the System.Console.ReadLine() method that will take a
I'd like to take the following if possible and combine them: public static T[]
I've written an extension method that can take an arbitrary number or OrderBy()'s and
Is it possible to have a C# lambda/delegate that can take a variable number
I'm trying to write a method that will take a single character string and
Is it possible to take a screen capture of a particular area of a
Is it possible to take only the first two lines from a wrapped text

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.