为 PuTTYTray 创建预制项目

标签 c windows visual-studio-2013 premake

我正在尝试使用 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

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

最佳答案

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

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

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

关于为 PuTTYTray 创建预制项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29940531/

相关文章:

c - 写入以空字节开头的内存

c - sockaddr_in 中需要单独的地址结构是什么?

导致静态和非静态声明错误的 C 程序

C++从文本文件检查操作系统

windows - 使用 Cabal、haskell origin 安装 unix-2.7.0.1 包

c# - 打开文件时,Visual Studio 2013崩溃

c++ - 二维数组不会在控制台网格中显示正确的内容

c - 删除和添加空白字符到底发生了什么?

wpf - 保存 WPF 窗口和位置

c# - 使用 C# 将 TTS 转为音频 (mp3)