在VC编译成功的C++文件,在linux中怎么会出现这样的错误??

[root@localhostshujujiegou]#g++TestPolynomal.cpp-oTestPolynomalInfileincludedfrom/usr... [root@localhost shujujiegou]# g++ TestPolynomal.cpp -o TestPolynomal
In file included from /usr/lib/gcc/i386-redhat-linux/3.4.5/../../../../include/c++/3.4.5/backward/iostream.h:31,
from Polynomal.h:4,
from TestPolynomal.cpp:2:
/usr/lib/gcc/i386-redhat-linux/3.4.5/../../../../include/c++/3.4.5/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
TestPolynomal.cpp: In function `int main()':
TestPolynomal.cpp:14: error: no matching function for call to `Polynomal::Polynomal(Polynomal)'
Polynomal.h:56: note: candidates are: Polynomal::Polynomal(Polynomal&)
TestPolynomal.cpp:17: error: no matching function for call to `Polynomal::Polynomal(Polynomal)'
Polynomal.h:56: note: candidates are: Polynomal::Polynomal(Polynomal&)
[root@localhost shujujiegou]#

答案越详细越好,包括如何修改
展开
 我来答
stablish
推荐于2016-02-23 · TA获得超过8785个赞
知道大有可为答主
回答量:5161
采纳率:50%
帮助的人:5461万
展开全部
你的C++源代码中应该有VC自动创建的类, 这个是不兼容于ANSI C标准的,

基本上, VC下的工程转移到linux平台都要经过一些移植 好了 不说废话

C++中头文件的标准写法是 #include <iostream>
如果写成xx.h,则会出现warning报告,C++标准中有说明;

在Polynomal类中的构造函数,声明与定义不一致,

头文件中声明为:Polynomal::(Polynomal&)
但在.cpp中定义为Polynomal::(Polynomal)
形参不一样而造成出错
jiangtao9999
2008-09-08 · TA获得超过1.2万个赞
知道大有可为答主
回答量:1.2万
采纳率:44%
帮助的人:8962万
展开全部
VC++ 的 C 代码和 GCC 的代码不兼容。
需要进行代码移植。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
QQ_Leaving
2008-09-08 · 超过15用户采纳过TA的回答
知道答主
回答量:92
采纳率:0%
帮助的人:0
展开全部
no matching function for call to `Polynomal::Polynomal(Polynomal)'
candidates are: Polynomal::Polynomal(Polynomal&)
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式