windows程序移植到linux总结

首先要写makefile,很简单,有专门博客,大家去搜一下..下面把编译时遇到的问题总结下.大部分解决方法是从网上找的,这里对看过文章的作者表示感谢.

1, max,min函数,自己代码实现了这两个函数,会和linux自带的有冲突.

      解决方法: 删除自己的函数

2, error: ‘STATUS’ is not a class or namespace

       解决方法:类内部枚举不要加namespace符号,直接写枚举变量

3, ‘>>’ should be ‘> >’ within a nested template argument list

      解决方法:>>之间加空格.linux防止歧义.

4, ‘std::shared_ptr’ has not been declared

    解决方法:std::tr1::shared_ptr,添加头文件#include

5, ‘atoi’ is not a member of ‘std’

    解决方法:#include

6, ‘sprintf_s’ was not declared in this scope

    解决方法:换为snprintf

7, there are no arguments to memcpy that depend on a template parameter, so a declaration of memcpy must be available

   解决方法: 主要是没包含头文件,添加#include , 或是"man memcpy",就可以看到依赖的头文件.

8, 'Utils’ is not a member of ‘mosek::fusion’

 

 

你可能感兴趣的:(windows程序移植到linux总结)