首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Cygwin上尝试编译checkinstall时出现GCC错误

在Cygwin上尝试编译checkinstall时出现GCC错误
EN

Stack Overflow用户
提问于 2018-02-08 13:59:09
回答 1查看 259关注 0票数 0

我在Windows7上运行Cygwin。我在尝试从源代码安装checkinstall实用程序时遇到了问题,而罪魁祸首似乎是gcc

当我运行/.configure时,我得到以下错误:

代码语言:javascript
复制
-bash: ./configure: No such file or directory

因此,我继续使用make,并得到了失败的输出,其中有很多错误,可能是由gcc引起的。output can be seen in its entirety here,但下面是它的第一行和最后几行。

代码语言:javascript
复制
$ make
    for file in locale/checkinstall-*.po ; do \
            case ${file} in \
                    locale/checkinstall-template.po)  ;; \
                    *) \
                            out=`echo $file | sed -s 's/po/mo/'` ; \
                            msgfmt -o ${out} ${file} ; \
                            if [ $? != 0 ] ; then \
                                    exit 1 ; \
                            fi ; \
                    ;; \
            esac ; \
    done
    make -C installwatch
    make[1]: Entering directory '/cygdrive/b/Users/Me/Desktop/checkinstall-1.6.2/installwatch'
    gcc -Wall -c -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT -DVERSION=\"0.7.0beta7\" installwatch.c
   In file included from /usr/local/include/sys/param.h:33:0,
                    from installwatch.c:31:
   /usr/local/include/sys/types.h:10:2: error: #error Only Win32 target is supported!
    #error Only Win32 target is supported!
     ^~~~~
   In file included from /usr/local/include/sys/param.h:33:0,
                    from installwatch.c:31:
   /usr/local/include/sys/types.h:90:3: error: unknown type name ‘time_t’
      time_t  tv_sec; /* Seconds */
      ^~~~~~
   In file included from installwatch.c:33:0:
   /usr/local/include/sys/stat.h:10:2: error: #error Only Win32 target is supported!
    #error Only Win32 target is supported!
     ^~~~~
   In file included from /usr/local/include/sys/stat.h:14:0,
                    from installwatch.c:33:
   /usr/local/include/io.h:199:28: error: expected ‘,’ or ‘;’ before ‘_findfirst32’
      _CRTIMP intptr_t __cdecl _findfirst32(const char *_Filename,struct _finddata32_t *_FindData);
                               ^~~~~~~~~~~~ 


  ...           


    installwatch.c: In function ‘fopen’:
   installwatch.c:2560:51: error: expected ‘)’ before ‘result’
      logg("%" PRIdPTR "\tfopen\t%s\t#%s\n",(intptr_t)result,
                                                       ^~~~~~
    installwatch.c:2560:8: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat=]
       logg("%" PRIdPTR "\tfopen\t%s\t#%s\n",(intptr_t)result,
            ^~~
    installwatch.c:2560:8: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat=]
    installwatch.c:2575:51: error: expected ‘)’ before ‘result’
       logg("%" PRIdPTR "\tfopen\t%s\t#%s\n",(intptr_t)result,
                                                       ^~~~~~
    installwatch.c:2575:8: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat=]
       logg("%" PRIdPTR "\tfopen\t%s\t#%s\n",(intptr_t)result,
            ^~~
    installwatch.c:2575:8: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat=]
    installwatch.c: At top level:
    installwatch.c:2600:7: error: conflicting types for ‘getcwd’
     char *getcwd(char *buffer,size_t size) {
           ^~~~~~
    In file included from /usr/local/include/sys/stat.h:14:0,
                     from installwatch.c:33:
    /usr/local/include/io.h:279:17: note: previous declaration of ‘getcwd’ was here
       char *__cdecl getcwd (char *, int) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
                     ^~~~~~
    installwatch.c:2664:30: error: unknown type name ‘uid_t’
     int lchown(const char *path, uid_t owner, gid_t group) {
                                  ^~~~~
    installwatch.c:2664:43: error: unknown type name ‘gid_t’
     int lchown(const char *path, uid_t owner, gid_t group) {
                                               ^~~~~
    installwatch.c:2749:5: error: conflicting types for ‘mkdir’
     int mkdir(const char *pathname, mode_t mode) {
         ^~~~~
    In file included from /usr/local/include/sys/stat.h:14:0,
                     from installwatch.c:33:
    /usr/local/include/io.h:280:15: note: previous declaration of ‘mkdir’ was here
       int __cdecl mkdir (const char *) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
                   ^~~~~
    installwatch.c:2983:7: error: conflicting types for ‘realpath’
     char *realpath(const char *file_name,char *resolved_name) {
           ^~~~~~~~
    installwatch.c:556:6: note: previous implicit declaration of ‘realpath’ was here
      if(!realpath(path,resolved_path)) {
          ^~~~~~~~
    installwatch.c:3309:5: error: conflicting types for ‘utime’
     int utime (const char *pathname, const struct utimbuf *newtimes) {
         ^~~~~
    In file included from /usr/local/include/utime.h:6:0,
                     from installwatch.c:47:
    /usr/local/include/sys/utime.h:115:26: note: previous definition of ‘utime’ was here
     __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) {
                              ^~~~~
    installwatch.c: In function ‘true_stat’:
    installwatch.c:153:1: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
    installwatch.c: In function ‘true_lstat’:
    installwatch.c:161:1: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
    installwatch.c: In function ‘true_mknod’:
    installwatch.c:157:1: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
    In file included from installwatch.c:35:0:
    installwatch.c: In function ‘open’:
    installwatch.c:2842:20: warning: ‘mode_t {aka short unsigned int}’ is promoted to ‘int’ when passed through ‘...’
      mode = va_arg(ap, mode_t);
                        ^
    installwatch.c:2842:20: note: (so you should pass ‘int’ not ‘mode_t {aka short unsigned int}’ to ‘va_arg’)
    installwatch.c:2842:20: note: if this code is reached, the program will abort
    At top level:
    installwatch.c:1040:12: warning: ‘__instw_printdirent64’ defined but not used [-Wunused-function]
     static int __instw_printdirent64(struct dirent64 *entry) {
                ^~~~~~~~~~~~~~~~~~~~~
    make[1]: *** [Makefile:22: installwatch.o] Error 1
    make[1]: Leaving directory '/cygdrive/b/Users/Me/Desktop/checkinstall-1.6.2/installwatch'
    make: *** [Makefile:11: all] Error 2

如果我做错了,我很抱歉,但我对这段代码和抛出的错误完全超出了我的深度。我已经多次尝试使用Cygwin安装程序重新安装gcc_core和其他gcc包,但都没有效果。

在我也遇到致命错误之前,我正在使用this guide从源代码编译gcc的最新版本,并决定从头开始,确定是否可以在不向我的Cygwin安装中添加更多臃肿的情况下解决问题。提前谢谢,非常感谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-02-11 00:48:47

似乎未将checkinstall应用程序配置为在cygwin上运行。它针对几个特定的Linux发行版系列进行了配置,并且有一个通用的源代码版本。

我已经下载并解压缩了checkinstall-1.6.2.tar.gz文件;它将解压到checkinstall-1.6.2目录中。在那里您可以找到checkinstall shell脚本。我没有时间费力阅读几千行shell代码。它似乎需要您构建和安装installwatch程序,我猜它将注册一个文件更改处理程序,以便识别所有新的和更改的文件和目录。我怀疑处理程序需要更改才能在cygwin中正常工作。您可能会成功发布到其中一个Cygwin mailing lists

HTH

道格

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48678581

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档