How do you compile/build/execute a C++ project in Geany?

前端 未结 6 524
予麋鹿
予麋鹿 2021-01-04 09:00

I really didn\'t think it would be this difficult. Geany clearly has the ability to create projects, add files to the projects, compile the individual files, but then even a

6条回答
  •  醉话见心
    2021-01-04 09:43

    Compiling a multi-file C++ project using Geany's F-keys requires that you first setup a Makefile and the corresponding settings in Geany (as described in previous answers); after such setup is completed the F-keys in Geany's Build drop-down menu become useful for that particular multi-file project.

    If however you just want to quickly compile a multi-file C++ project without having to setup a Makefile as well as Geany's settings, use the terminal at the bottom of Geany to type the command-line instruction for compiling a multi-file project:

    uberstudent@uberstudent:~$ g++ my_source1.cpp my_source2.cpp -o my_executable
    

    You can then execute your executable with:

    uberstudent@uberstudent:~$ ./my_executable
    

    (Note that the above applies to Geany on Linux; I have not tested the above commands on other operating systems.)

提交回复
热议问题