从 premake 生成 VS2010 项目时似乎出现错误,即使使用“Hello World”示例(也尝试使用 clink(here)和 premake 本身)
你好ç
#include <stdio.h>
int main(void) {
puts("Hello, word!");
return 0;
}
premake4.lua
-- premake4.lua
solution "HelloWorld"
configurations "Any"
project "HelloWorld"
kind "ConsoleApp"
language "C"
files "*.c"
defines { "DEBUG" }
flags { "Symbols" }
这个简单的示例无法链接到消息“LINK:致命错误 LNK1123:转换为 COFF 期间失败:文件无效或损坏”
日志文件说:
Build started 09-02-2015 16:06:34.
1>Project "E:\D\Source\premake-dev\pm-test\HelloWorld.vcxproj" on node 2 (build target(s)).
1>InitializeBuildStatus:
Creating "obj\Any\HelloWorld.unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D DEBUG /D _MBCS /Gm /EHsc /RTC1 /MDd /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo"obj\Any\\" /Fd".\HelloWorld.pdb" /Gd /TC /analyze- /errorReport:prompt hello.c
hello.c
ManifestResourceCompile:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo /fo"obj\Any\HelloWorld.exe.embed.manifest.res" obj\Any\HelloWorld_manifest.rc
Link:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:".\HelloWorld.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"obj\Any\HelloWorld.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"E:\D\Source\premake-dev\pm-test\HelloWorld.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /ENTRY:"mainCRTStartup" /DYNAMICBASE /NXCOMPAT /IMPLIB:".\HelloWorld.lib" /MACHINE:X86 obj\Any\HelloWorld.exe.embed.manifest.res
obj\Any\hello.obj
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
1>Done Building Project "E:\D\Source\premake-dev\pm-test\HelloWorld.vcxproj" (build target(s)) -- FAILED.
Build FAILED.
Time Elapsed 00:00:00.33