1

我正在尝试使用 Premake 4 为 PuTTYTray 创建 VS2013 项目文件

最初我只是尝试构建 putty.exe,但我希望能够基于原始项目文件构建原始套件。

solution "PuTTYTray"
configurations {"Debug", "Release"}

    project "PuTTY"
        kind "ConsoleApp"
        language "C++"

        files { 
            "*.h", 
            "*.c",
            "windows/**.c", 
            "windows/**.h" 
        }

        excludes {
            "pscp.c", 
            "be_all.c", 
            "psftp.c", 
            "be_all_u.c", 
            "be_none.c",
            "be_nos*",
            "be_ssh.c",
            "nocproxy.c",
            "puttytel*",
            "notiming.c",
            "noterm.c",
            "noprint.c",
            "noshare.c",
            "pproxy.c",
            "windows/wincons.c",
            "cmdgen.c",
            "time.c",
            "windows/winnojmp.c",
            "windows/winplink.c",
            "windows/winsftp.c",

        }

        defines {
            "_WINDOWS", 
            "NO_GSSAPI", 
            "WIN32", 
            "SECURITY_WIN32",
            "_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1",
            "_CRT_SECURE_NO_WARNINGS=1"
        }

        links {
            "advapi32",
            "comctl32",
            "imm32",
            "winmm"
        }

        includedirs {"windows","unix","."}

我相信我的配置设置与原始配置类似,但出现以下错误:

Error   34  error C1083: Cannot open include file: 'termios.h': No such file or directory   D:\Git\Other\PuTTYTray\windows\cthelper\ptyfork.c   2   1   PuTTY
Error   15  error C1083: Cannot open include file: 'unistd.h': No such file or directory    D:\Git\Other\PuTTYTray\windows\cthelper\buffer.c    4   1   PuTTY
Error   16  error C1083: Cannot open include file: 'unistd.h': No such file or directory    D:\Git\Other\PuTTYTray\windows\cthelper\cthelper.c  4   1   PuTTY
Error   17  error C1083: Cannot open include file: 'unistd.h': No such file or directory    d:\git\other\puttytray\windows\cthelper\ourhdr.h    10  1   PuTTY
Error   35  error C1083: Cannot open include file: 'unistd.h': No such file or directory    d:\git\other\puttytray\windows\cthelper\ourhdr.h    10  1   PuTTY
Error   22  error C2059: syntax error : ')' d:\git\other\puttytray\windows\cthelper\mm.h    7   1   PuTTY
...
Error   19  error C2061: syntax error : identifier 'len'    d:\git\other\puttytray\windows\cthelper\mm.h    7   1   PuTTY
Error   30  error C2061: syntax error : identifier 'len'    d:\git\other\puttytray\windows\cthelper\mm.h    10  1   PuTTY
Error   24  error C2061: syntax error : identifier 'nmemb'  d:\git\other\puttytray\windows\cthelper\mm.h    9   1   PuTTY
Error   29  error C2081: 'ssize_t' : name in formal parameter list illegal  d:\git\other\puttytray\windows\cthelper\mm.h    10  1   PuTTY
Error   18  error C2146: syntax error : missing ')' before identifier 'len' d:\git\other\puttytray\windows\cthelper\mm.h    7   1   PuTTY
Error   28  error C2146: syntax error : missing ')' before identifier 'len' d:\git\other\puttytray\windows\cthelper\mm.h    10  1   PuTTY
Error   23  error C2146: syntax error : missing ')' before identifier 'nmemb'   d:\git\other\puttytray\windows\cthelper\mm.h    9   1   PuTTY

我该怎么做才能更接近标记?我真的不明白我在这里做错了什么。

4

1 回答 1

0

问题是我没有正确的排除列表 - 可以通过在源的根目录中运行 perl 脚本来生成原始项目文件。

通过正确的排除和一些额外的库导入,我可以成功创建和使用该解决方案。

@ostrokarch 的笔记在这里为我指明了正确的方向。

于 2015-04-30T07:43:43.637 回答