question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need better /MD multithreaded dll support

See original GitHub issue

I’m trying to compile the node.js extension with the following binding.gyp file:

{
  "targets": [
    {
      "target_name": "MyLib",
      "type": "shared_library",
      "sources": [ ... ],
      "conditions": [
        [ "OS=='win'", { "libraries": [
          "..\\Library\\binaries\\x64\\Release\\mylib.lib"
        ] } ]
      ]
    }
  ]
}

and VS2012 Pro. The command line is following:

node-gyp configure --msvs_version=2012 && node-gyp build

This causes the error:

error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease'

Changing the property “RuntimeLibrary” in the vcxproj file from “MultiThreaded” to “MultiThreadedDLL” fixes compilation.

Is it correct workaround?

Thanks, Alex

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
springmeyercommented, Jan 14, 2014

Note: I also found I could override the settings within my binding.gyp as mentioned here by doing:

            'msvs_settings': {
              'VCCLCompilerTool': {
                 'AdditionalOptions': [
                  '/GR',
                  '/MD',
                  '/EHsc'
                ]
              },

But this seems less ideal because it results in many warnings about the settings being overridden on the command line.

0reactions
sapercommented, Oct 22, 2019

I think this can be closed - looks like we do provide /MD support if one builds node that way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MD, -MT, -LD (Use Run-Time Library) - Microsoft Learn
Indicates whether a multithreaded module is a DLL and specifies retail or debug versions of the run-time library. Syntax. Copy. /MD[d] / ...
Read more >
Multi-threaded DLL (/MD) vs Multi-threaded (/MT) [duplicate]
One project build as exe with using above three libraries. I need to host this application without CLR support in windows XP. so...
Read more >
How to build static multithread debug dll ... - Google Groups
I am building latest master branch webrtc for vs2015 using the new gn build but can't figure out how to get it to...
Read more >
build libmxnet.dll with /MD (Multithreaded DLL runtime)
Basically, I only need to be able to use the prediction API (and nothing more), since the networks will have been trained under...
Read more >
Multi-threaded DLL (/MD)crash the application on Relese mode
No, you've given us absolutely nothing to go on. I'm sure you'll get a few guesses, but that's all and will most likely...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found