【问题标题】:compile error in cygwincygwin编译错误
【发布时间】:2011-04-14 13:12:19
【问题描述】:

当我通过这个命令编译 sim_routing.cc 程序时出现这些错误:

../../bin/cxx sim_routing.cc
g++ -Wall -o sim_routing sim_routing.cxx

显示以下错误:

../../common/priority_q.h : In member function 'bool guardedQueue<ITEM>::Validate(Const char*);
error : there are no argument to 'strcat' that depend on template parameter so a declaration of 'strcat' must be avaible.
error : <if you use -fpermissive  g++ will accept your code but allowing use of undeclared name is deprecated>

当我尝试更改commom/priority_q.h 文件时,它显示它是只读文件,因此无法进行更改。

如何纠正这些错误?

【问题讨论】:

    标签: linux cygwin compilation g++


    【解决方案1】:

    不确定,但您可以尝试包括

    #include <cstring>
    

    之前您将 priority_q.h 文件包含在您的代码中。这应该在处理该模板之前将strcat 的声明纳入范围。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-09-05
      • 1970-01-01
      • 2013-02-10
      • 2012-01-22
      • 1970-01-01
      • 2012-12-21
      • 1970-01-01
      相关资源
      最近更新 更多