premake设置静态运行库

来源:互联网 发布:按键精灵淘宝秒杀脚本 编辑:程序博客网 时间:2024/06/06 02:36
premake设置静态运行库

(金庆的专栏)

链接protobuf库时,碰到RuntimeLibrary不匹配:
1>libprotobufd.lib(int128.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MTd_StaticDebug”不匹配值“MDd_DynamicDebug”(baseapp.obj 中)

原因为protobuf使用了静态运行库,而应用工程是用premake生成的,默认使用动态运行库。

premake的runtime只能设置 Debug 或 Release:
runtime "Release"

应该使用 flags { "StaticRuntime" } 来设置静态运行库。

参考:
http://industriousone.com/topic/how-set-runtime-library

0 0
原创粉丝点击