kind "SharedLib"
language "C++"
defines "DLL_EXPORT"
targetname "read_cad_file"
targetextension ".arx"
我使用ObjectARX开发,我想编译使用premake5和vs2015我的项目。一些在脚本中的设置是以上。在此设置下,在属性 - > C / C ++ - >代码发生 - >运行时库,运行时库是多线程调试(/ MTD)。我想问一下如何使用premake5其更改为多线程DLL(/ MD)?非常感谢:)
我不知道运行时的静态或DLL版本。但是,调试和发布应该是由runtime
关键字切换。看到:
configuration "Debug"
buildoptions "/MDd"
configuration "Release"
buildoptions "/MD"
configuration {}
所以,我的项目是不是一个共享库,而是一个exe。
我加了下面的“过滤器”部分:
filter "configurations:Debug"
architecture "x86_64"
links {"libprotobufd"}
defines {"DEBUG"}
symbols "On"
libdirs { baseLibPath .. "debug" } -- baseLibPath was defined elsewhere
postbuildcommands {}
debugdir "$(TargetDir)"
flags {"staticruntime"} -- this is what worked for me
我不知道这是否会解决你的问题,但给它一个去?
我还是比较新的premake,所以借此与一粒盐。
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"
这是一个完整premake文件。