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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:53:06+00:00 2026-06-14T15:53:06+00:00

I have a WPF app I’m compiling in Visual Studio 2010 that uses a

  • 0

I have a WPF app I’m compiling in Visual Studio 2010 that uses a CLR .dll to interact with some unmanaged C/C++ code. The idea is that WPF references the CLR .dll which in turn references the unmanaged code. Unfortunately, I’m running into terrible linking issues because the unmanaged C/C++ code and related libraries all link statically to the C/C++ runtime, but if I try to use that code generation method on the CLR .dll, it throws an error because the /clr option and statically linking to the CRT are incompatible. I need to somehow glue these things together.

My thought was to try to create an additional .dll that just contained all of the unmanaged code in a single package (also linked statically to the CRT), then link that to the CLR .dll, which in turn links into the app (blech!). I tried to make such a .dll, but the problem is that (maybe obviously?) it didn’t pull in any of the symbols from the static .lib files because it didn’t need any of them. I tried forcing symbol references (/OPT:NOREF), but that didn’t seem to do anything. It’s just an empty .dll that “links” to the libs but isn’t actually doing anything. So a big fail on that idea.

Am I approaching this whole thing all wrong?

I don’t have source code for some of the unmanaged libraries, so I can’t recompile them to link dynamically to the CRT. These linking problems are getting really frustrating!

Thanks for any suggestions!

UPDATE: I guess this is tantamount to trying to mix /MT and /MD modules together, which, according to this, is not possible. How is it that you’re supposed to link projects in which you don’t have control over third party libraries? You just hope that they’ve all chosen to use the same runtime library linking method?! Seems like a horrible idea…

  • 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-14T15:53:08+00:00Added an answer on June 14, 2026 at 3:53 pm

    The solution appears to be that you should not attempt to link /MT and /MD-compiled libraries together. I’m a bit surprised by it, because there are instances where you may not have control over the libraries you have to link to. And if you’re trying to link into a CLR project, you’d better hope those libraries were compiled with /MD, or you’re in trouble! In my case, I was able to solve it by recompiling some external libraries using /MD. There was one in particular I didn’t have access to code for, and its DEFAULTLIB was a statically linked C-runtime (libcmt.lib), but somehow I was able to link to it without issue.

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

Sidebar

Related Questions

I have a WPF app that uses DataGrid to display some data. When I
Context: I have a WPF App that uses certain unmanaged DLLs in the D:\WordAutomation\MyApp_Source\Executables\MyApp
I have a WPF app that uses Entity Framework for accessing DB. When the
I have a WPF app that works beautifully if I debug (F5) in Visual
I have WPF App, that needs to be update some data , after computer
I have a WPF app that uses DispatcherTimer to update a clock tick. However,
I have a WPF app that uses an Entity Framework Model. One of the
I have a wpf app that uses a wcf webservice. Its my webservice and
I have a WPF app that uses a non-WPF vendor library. My app does
I have a WPF app that uses a business object called Visit, it has

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.