我在x64的Ubuntu12.04上安装了免费的pascal。当我运行fp文件时,它说:
./fp: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
我搜索了Google,发现我已经安装了libncurses.so.5库
/lib/x86_64-linux-gnu/libncurses.so.5.9
链接指向它
/lib/x86_64-linux-gnu/libncurses.so.5
因此,我在/lib中创建了一个链
让我进一步解释..。是否宜使用,例如:
#ifdef _WIN32
void someFunction()
{
// windows version of the function which makes Windows API Calls
}
#elif defined(__linux__)
void someFunction()
{
// linux version of the function which makes POSIX calls
}
#endif
或者为每个操作系统创建单独的源代码文件,然后在makefile或任何构建工具中使用条件代码来编译基于操作系统的源