识别 Linux 友好代码的可能方法
我有一个程序,可以通过串行端口访问设备并读取闪存并将其显示在命令提示符中。它将读数保存到 ms access 以进行记录。
我想在 Linux 上使用这个程序,所以我想如果我删除 MS 访问日志记录代码,它将作为串行端口进行移植,并且命令提示符在 Linux 中应该是相同的。
我正在寻找一种方法来识别任何不能在 Linux 上运行的代码。最好的情况是一个程序,它获取我的源文件并突出显示有问题的代码行。
如果做不到这一点,识别需要更改的代码以使程序在 Linux 上运行的最佳方法是什么?
编辑:我必须使用 borland 5.5 编译器,并且对 Linux 机器进行测试的访问非常有限,因此如果可能的话,需要在 Windows 环境中构建程序。
I have a program that accesses a device through the serial port and reads the flash memory and displays it in command prompt. It saves the readings to ms access for logging.
I want to use this program on Linux so I figured that if I remove the MS access logging code it would port as serial ports and command prompt should be that same in linux.
What I am looking for is a way to identify any code that will not run on linux. Best case scenario would be a program that takes my source file and highlights the offending lines of code.
failing that what are the best ways of identifying code that needs to be changed to make the program run on linux?
EDIT: I have to use the borland 5.5 compiler and have very limited access to linux machines for testing so need to build the program in a windows environment if that is possible.
只需尝试在 Linux 上编译代码并尝试查看编译错误,任何不属于 Linux 的内容都不会编译,您需要为 Linux 端口移植/编写类似的功能。
或者我在这里遗漏了什么?这看起来相当简单。
Just try compiling the code on Linux and try to look in to the compile errors, Whatever doesn't belong to Linux won't compile and you need to port/write similar functionality for Linux port.
Or am I missing something here? This looks fairly straightforward.