Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/91.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ premake5:如何在vs2015中将运行库设置为多线程DLL(/MD)_C++_Visual Studio 2015_Autocad_Premake - Fatal编程技术网

C++ premake5:如何在vs2015中将运行库设置为多线程DLL(/MD)

C++ premake5:如何在vs2015中将运行库设置为多线程DLL(/MD),c++,visual-studio-2015,autocad,premake,C++,Visual Studio 2015,Autocad,Premake,我正在使用objectARX进行开发,我想使用premake5和vs2015编译我的项目。脚本中的一些设置如上所述。 在此设置下,在properties->C/C++->Code Generation->Runtime Library中,运行库是多线程调试(/MTd)。 我想问一下如何使用premake5将其更改为多线程DLL(/MD)?非常感谢:)我不知道运行时的静态或DLL版本。但是调试和发布应该可以通过运行时关键字进行切换。见: 这是完整的premake文件。因此,我的项目不是一个共享库

我正在使用objectARX进行开发,我想使用premake5vs2015编译我的项目。脚本中的一些设置如上所述。 在此设置下,在properties->C/C++->Code Generation->Runtime Library中,运行库是多线程调试(/MTd)。
我想问一下如何使用premake5将其更改为多线程DLL(/MD)?非常感谢:)

我不知道运行时的静态或DLL版本。但是调试和发布应该可以通过
运行时
关键字进行切换。见:


这是完整的premake文件。

因此,我的项目不是一个共享库,而是一个exe

project "read_cad_file"
  kind "SharedLib"
  language "C++"
  defines "DLL_EXPORT"
  targetname "read_cad_file"
  targetextension ".arx"
  files "*.cpp"
  files "*.def"
  files "*.lua"
  sysincludedirs "../../../third_party/object_arx/inc-x64/"     
  sysincludedirs "../../../third_party/object_arx/inc/"
  includedirs "../../../third_party/object_arx/inc/"
  includedirs "../../../third_party/object_arx/inc-x64/"
  libdirs "../../../third_party/object_arx/lib-x64/"
  links "ac1st22.lib"
  links "acad.lib"
  links "accore.lib"
  links "acdb22.lib"
  links "acge22.lib"
  links "acgiapi.lib"
  links "acui22.lib"
  links "adui22.lib"
  links "advapi32.lib"
  links "rxapi.lib"
我在“过滤器”部分添加了以下内容:

   configuration "Debug"
      buildoptions "/MDd"
   configuration "Release"
      buildoptions "/MD"
   configuration {}
我不确定这是否能解决你的问题,但试一试


我对premake还比较陌生,所以请对此持保留态度。

您要寻找的关键是。虽然默认情况下应该将其关闭,但也可以显式地将其关闭


要在premake中更改运行时库,需要使用两个关键字-
staticruntime
runtime

要在premake中使用/MT,请执行以下操作:

staticruntime "Off"
staticruntime "on"
runtime "Release"
staticruntime "on"
runtime "Debug"
staticruntime "off"
runtime "Release"
要在premake中使用/MTd,请执行以下操作:

staticruntime "Off"
staticruntime "on"
runtime "Release"
staticruntime "on"
runtime "Debug"
staticruntime "off"
runtime "Release"
要在premake中使用/MD,请执行以下操作:

staticruntime "Off"
staticruntime "on"
runtime "Release"
staticruntime "on"
runtime "Debug"
staticruntime "off"
runtime "Release"
要在premake中使用/MDd,请执行以下操作:

staticruntime "Off"
staticruntime "on"
runtime "Release"
staticruntime "on"
runtime "Debug"
staticruntime "off"
runtime "Release"

我以前尝试过关键字runtime,但它不起作用。然后发布完整的premake文件。如果它真的“不起作用”,你应该在premake项目中提交一个bug。我在下面的答案中发布了完整的premake文件,谢谢!您仍处于调试配置,请切换到发布配置。您能否解释这些选项将如何以及为什么解决OP的问题?