【发布时间】:2014-03-24 22:52:46
【问题描述】:
我正在开发一种工具,该工具提供了一种在它提供的框架内编写小型 c++ 代码的工具。该工具是基于windows和linux的。我们将代码写入窗口。出于测试目的,首先在 Windows 上进行编译。最后执行 linux 构建以在 linux 上实际运行整个生产测试。
我创建了一个具有以下签名的函数:
string myClass::myFunc(string& start, bool myflag, Class C1 & c1,
long a=0, const char* b=NULL, void * c=NULL);
现在,当该工具在 Windows(Microsoft Visual Express)上运行时,一切正常并且所有测试都通过了。
但是,当代码在 linux 上编译时,我收到一条错误消息,指出“没有匹配的调用函数”。
这是函数签名:
string myClass::myFunc(string& start, bool myflag, Class C1 & c1,
long a=0, const char* b=NULL, void * c=NULL);
错误信息:
myfile.cpp: no matching function for call to
myClass::myFunc(std::string, bool, classC1&, long int&,
const char *&, void*&)
myfile.h: note: candidates are:
std::string myClass:myFunc(std::string&, bool&, classC1&,
long int, const char*, void*)
我无权访问 linux 服务器。因此不能提及 linux 发行版或任何其他细节。
提前致谢。
- ftp
【问题讨论】:
-
注意到 myfile.h 注释有 bool 作为参考。这是为什么呢?
-
是的,我也注意到了。也许该工具在 linux 和 windows 中生成的代码不同。不幸的是,我无法访问 linux 机器。因此无法确定。
-
你在做的是不是“交叉编译”。只是维护一个可移植的代码库。
-
同意。删除了不正确的标签。
标签: c++ linux compilation compiler-errors