我决定放弃我的 Windows 安装,现在将 Debian 作为我的默认操作系统运行。我一直在 Windows 中进行编码,特别是使用 Visual Studio。我目前正在尝试习惯在 linux 下编译我的代码。
虽然我还有很多文档要阅读,而且不要指望你们让我觉得它太容易了,但如果能得到一些关于从哪里开始的指示仍然会很好。我有一些具体问题,但请随时提出/推荐有关该主题的任何其他内容。
非常感谢任何帮助、指南和文档链接(最好是针对初学者的)!
最佳答案
What are recommended guides on creating a make file, how do I compile from this makefile (do I call g++ myself, do I use 'make'?)
您通过调用“make”从 makefile 构建。在您的 makefile 中,您使用 g++ 和 ld 进行编译和链接。
Looking at other linux software, they almost always seem to have a 'configure' file. What exactly does it do? Does it only check if the required libraries are installed or does it more than just checking requirements?
这是一个脚本,通常用于根据用于构建的环境设置各种事物。有时它只是一个基本的 shell 脚本,有时它会调用 Autoconf 等工具来发现构建时可用的内容。 “配置”脚本通常也是用户指定要构建或排除的各种可选内容的地方,例如对实验性功能的支持。
How do I link libraries, and how does this relate to my makefile or g++ parameters? In windows I would compile the library, include some header files, tell my linker what additional lib file to link, and copy a dll file. How exactly does this process work in linux?
ld 是 GNU 链接器。您可以单独调用它(这是大多数 makefile 最终会执行的操作),或者您可以让 g++ 委托(delegate)给它。传递给 g++ 和 ld 的选项决定了在哪里查找包含的头文件、要链接的库以及如何输出结果。
Recommendations for code editors? I am currently using nano and I've heard of vim and emacs, but don't know what the benefits of them are over eachother. Are there any others, and why would I consider them over any of the previous three? Note: I am not looking for an IDE.
Vim 和 Emacs 是非常灵活的编辑器,它们支持一大堆不同的用法。使用你觉得最好的任何东西,但我建议你可能需要一些最小的东西,比如语法突出显示。
https://stackoverflow.com/questions/623040/