Need to port MS Visual C++ to Linux G++

余生长醉 提交于 2019-12-03 16:28:29

I would start by turning the compiler warnings on and fixing all warnings.

-Wall -Wextra -Wstrict-aliasing -pedantic -Werror -Wunreachable-code

If you fix all the warning it will solve a lot of problems that you may never have seen. Especially when porting between different compilers (as these represents problems that will affect porting as different compilers can do different things).

When on MS compiler. Turn the warning level upto 4 and tell the compiler to treat all warnings as errors. The combination of these will get a lot of errors.

With this codebase size, if you start by fixing random memory management issues that you are already noticing, you will soon have a working application. This assumes that you are diagnosing each segfault correctly which is not very obvious from the question. The process of learning what the new code exactly does and how will go hand in hand with the process of debugging.

If it already compiles in Linux, you should not need to learn about any other operating systems, assuming that you did not "comment out" any code that you did not understand while trying to make it work, or otherwise avoided references to Windows specific libraries that may have played a role in the application.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!