C++ development on linux - where do I start?

前端 未结 12 1899
感动是毒
感动是毒 2020-12-12 14:32

I decided to leave my windows install behind and am now running Debian as my default OS. I have always coded in Windows and specifically with Visual Studio. I am currently t

12条回答
  •  一向
    一向 (楼主)
    2020-12-12 15:09

    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'?)

    I learned how to write makefiles by reading the GNU Make manual.

    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?

    The configure file is usually associated with autotools. As the name of the script suggests, it allows you to configure the software. From the perspective of the developer this mostly means setting macros, which determine variables, which libraries are available, and such. It also tests for the availability of libraries. In the end the script generates a GNU Makefile, which you can then use to actually build and install the software.

    The GNU build system is only one of many. I don't particularly like the GNU build system as it tends to be slower than others, and generates an ugly Makefile. Some of the more popular ones are CMake, Jam (Boost Jam might be of interest for C++) and waf. Some build systems simply generate Makefiles, while others provide a completely new build system. For simple projects writing a Makefile by hand would be easy, but "dependency checking" (for libraries, etc) would also have to be done manually.

    Edit: Brian Gianforcaro also pointed this out.

提交回复
热议问题