{"id":1542,"date":"2015-08-30T23:33:30","date_gmt":"2015-08-30T21:33:30","guid":{"rendered":"http:\/\/www.blue.pri.ee\/ttu\/?page_id=1542"},"modified":"2024-09-11T20:49:07","modified_gmt":"2024-09-11T18:49:07","slug":"geany-installion-guide","status":"publish","type":"page","link":"https:\/\/blue.pri.ee\/ttu\/resources\/software-setup-for-programming\/geany-installion-guide\/","title":{"rendered":"Geany and compiler installation guide"},"content":{"rendered":"<p>This page describes different methods for installing Geany and the compiler on your computer.<\/p>\n<p>Once finished, go and read how to configure Geany to make it more useful for you and check out a few hints on using it.<br \/>\nGuide: Geany configuration and usage.<\/p>\n<div class=\"su-tabs su-tabs-style-default su-tabs-mobile-stack\" data-active=\"1\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-tabs-nav\"><span class=\"\" data-url=\"\" data-target=\"blank\" tabindex=\"0\" role=\"button\">Linux<\/span><span class=\"\" data-url=\"\" data-target=\"blank\" tabindex=\"0\" role=\"button\">Win 11\/10\/8.1\/8\/7  (easy install)<\/span><span class=\"\" data-url=\"\" data-target=\"blank\" tabindex=\"0\" role=\"button\">Win 10 (manual install) <\/span><\/div><div class=\"su-tabs-panes\"><div class=\"su-tabs-pane su-u-clearfix su-u-trim\" data-title=\"Linux\">\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-chevron su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Click me to see this as a video<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"><iframe loading=\"lazy\" width=\"640\" height=\"420\" allowfullscreen=\"allowfullscreen\" frameborder=\"0\" src=\"https:\/\/echo360.org.uk\/media\/d3366924-dd8e-4c12-a316-83054ae06922\/public?autoplay=false&amp;automute=false\"><\/iframe><\/div><\/div>\n<p>The setup in Linux is the most straight forward. The guide should function on all debian-based Linux distros using apt (e.g. Ubuntu, Kubuntu, Pop!_OS, Linux Mint, &#8230;)<\/p>\n<p style=\"padding-left: 30px;\"><em>If your distro has a different package manager, then you should read into its manual or use the graphic interface.<\/em><\/p>\n<ol>\n<li>Open the terminal \/ console. <em>Typically it is available both from the launcher or by right-clicking the mouse.<\/em><\/li>\n<li>Run the following commands:<\/li>\n<\/ol>\n<pre class=\"toolbar:2 lang:default decode:true lang: \">sudo apt update\r\nsudo apt install geany geany-plugins build-essential valgrind cppcheck<\/pre>\n<p>You&#8217;re done!<\/p>\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-chevron su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Click me to see what the commands really do<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\">\n<ul>\n<li><span class=\"lang:c highlight:0 decode:true crayon-inline\">sudo<\/span>\u00a0 the command that follows this is executed with root (a.k.a. administrative) privileges. This allows modifications to the system.<\/li>\n<li><span class=\"lang:c highlight:0 decode:true crayon-inline\">apt<\/span>\u00a0 &#8211; this is a package manager used by many Linux distributions to download software from online repositories (Windows has a similar tool called <span class=\"lang:c highlight:0 decode:true crayon-inline \">winget<\/span>\u00a0)<\/li>\n<li><span class=\"lang:c highlight:0 decode:true crayon-inline\">apt update<\/span>\u00a0 &#8211; updates the package information that is available on the internet (what software is available and their versions. Also notifies if some software can be updated).<\/li>\n<li><span class=\"lang:c highlight:0 decode:true crayon-inline \">apt install<\/span>\u00a0 &#8211; installs the list of packages listed after the command.<\/li>\n<\/ul>\n<p>Installed packages<\/p>\n<ul>\n<li><span class=\"lang:c highlight:0 decode:true crayon-inline\">geany<\/span>\u00a0 and <span class=\"lang:c highlight:0 decode:true crayon-inline\">geany-plugins<\/span>\u00a0 contain the text editor for writing code, as well as some quality of life plugins.<\/li>\n<li><span class=\"lang:c highlight:0 decode:true crayon-inline\">build-essential<\/span>\u00a0 is a set of tools to compile and debug software in various programming languages.<\/li>\n<li><span class=\"lang:c highlight:0 decode:true crayon-inline\">valgrind<\/span>\u00a0 is a memory analysis tool. It analyses our programs when they are running, detecting memory leaks etc.<\/li>\n<li><span class=\"lang:c highlight:0 decode:true crayon-inline\">cppcheck<\/span>\u00a0 is a linter, which is used for static analysis of the source code. It finds common mistakes that are otherwise not reported and might go unnoticed.<\/li>\n<\/ul>\n<\/div><\/div>\n<\/div>\n<div class=\"su-tabs-pane su-u-clearfix su-u-trim\" data-title=\"Win 11\/10\/8.1\/8\/7  (easy install)\">\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-chevron su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Click me to see this as a video<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"><iframe loading=\"lazy\" width=\"640\" height=\"420\" allowfullscreen=\"allowfullscreen\" frameborder=\"0\" src=\"https:\/\/echo360.org.uk\/media\/b96f8a35-40c8-4e08-924d-9ecabfae5c2a\/public?autoplay=false&amp;automute=false\"><\/iframe><\/div><\/div>\n<p>The simplest way to install the required software is using Chocolatey package manager (<a href=\"https:\/\/chocolatey.org\/install\">https:\/\/chocolatey.org\/install<\/a>). Just run the following command in your Windows command line to install all the required software in one go:<\/p>\n<pre class=\"toolbar:2 lang:default highlight:0 decode:true \">choco install geany geany-plugins mingw make<\/pre>\n<p>This will install the text editor and compiler. Everything will be set up automatically, no need to do anything else.<\/p>\n<p>NB! If your OS language differs from English and you wish to have the IDE in English, you can delete or rename the folder \/share\/locale under Geany installation directory.<\/p>\n<\/div>\n<div class=\"su-tabs-pane su-u-clearfix su-u-trim\" data-title=\"Win 10 (manual install) \">\n<div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-chevron su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Click me to see this as a video<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"><iframe loading=\"lazy\" width=\"640\" height=\"420\" allowfullscreen=\"allowfullscreen\" frameborder=\"0\" src=\"https:\/\/echo360.org.uk\/media\/b96f8a35-40c8-4e08-924d-9ecabfae5c2a\/public?autoplay=false&amp;automute=false\"><\/iframe><\/div><\/div>\n<p>First of all, you should download 2 programs:<\/p>\n<ol>\n<li>Geany code editor: <a href=\"http:\/\/www.geany.org\/Download\/Releases\">http:\/\/www.geany.org\/Download\/Releases<\/a><\/li>\n<li>MinGW package (used to download GCC compiler): <a href=\"https:\/\/osdn.net\/projects\/mingw\/downloads\/68260\/mingw-get-setup.exe\/\">https:\/\/osdn.net\/projects\/mingw\/downloads\/68260\/mingw-get-setup.exe\/\u00a0<\/a><\/li>\n<\/ol>\n<p>Let&#8217;s start from the compiler<\/p>\n<ol>\n<li>Run and install the MinGW package\u00a0manager<br \/>\n<a href=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2020\/08\/mingw_1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5249 size-full\" src=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2020\/08\/mingw_1.png\" alt=\"\" width=\"598\" height=\"461\" srcset=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2020\/08\/mingw_1.png 598w, https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2020\/08\/mingw_1-300x231.png 300w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/a><\/li>\n<li>Now we have to choose the packages that will be installed. We will need &#8216;mingw32-base&#8217; (1). Select it and mark it for installation (2). Now all that remains is to confirm our selection and for that choose &#8216;Installation&#8217; (3) and &#8216;apply changes&#8217;<\/li>\n<li><a href=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2020\/08\/mingw_packages.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5253 size-full\" src=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2020\/08\/mingw_packages.png\" alt=\"\" width=\"873\" height=\"293\" srcset=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2020\/08\/mingw_packages.png 873w, https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2020\/08\/mingw_packages-300x101.png 300w, https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2020\/08\/mingw_packages-768x258.png 768w\" sizes=\"auto, (max-width: 873px) 100vw, 873px\" \/><\/a>In the next window we can confirm that the wanted components are selected and start the install. <a href=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/mingw3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1293 size-full\" src=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/mingw3.png\" alt=\"\" width=\"613\" height=\"407\" srcset=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/mingw3.png 613w, https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/mingw3-300x199.png 300w\" sizes=\"auto, (max-width: 613px) 100vw, 613px\" \/><\/a><\/li>\n<li>Now that the compiler is installed, we can go ahead and set up Geany. The\u00a0setup is straight forward and can be installed with the default settings.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>The required components are now installed. Now we need to make them communicate with each other and for that we need to modify\u00a0the environment.<\/p>\n<ol>\n<li>Click the right mouse button over the start button and select &#8216;System&#8217;<br \/>\n<a href=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1294 size-full\" src=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win1.png\" alt=\"\" width=\"293\" height=\"430\" srcset=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win1.png 293w, https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win1-204x300.png 204w\" sizes=\"auto, (max-width: 293px) 100vw, 293px\" \/><\/a><\/li>\n<li data-select-like-a-boss=\"1\">Now go to <em>&#8216;Advanced system settings&#8217;<\/em><br \/>\n<a href=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1281 size-full\" src=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win2.png\" alt=\"win2\" width=\"332\" height=\"266\" srcset=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win2.png 332w, https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win2-300x240.png 300w\" sizes=\"auto, (max-width: 332px) 100vw, 332px\" \/><\/a><\/li>\n<li>From here we choose &#8216;Environment variables&#8217;\u00a0from the <em>&#8216;Advanced&#8217;<\/em>\u00a0tab.<br \/>\n<a href=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1296 size-full\" src=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win3.png\" alt=\"win3\" width=\"410\" height=\"466\" srcset=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win3.png 410w, https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win3-264x300.png 264w\" sizes=\"auto, (max-width: 410px) 100vw, 410px\" \/><\/a><\/li>\n<li>Look for the &#8216;Path&#8217; variable under <em>&#8216;System variables&#8217;\u00a0<\/em>(this can also be written in uppercase)\u00a0and click &#8216;Edit&#8217;.<a href=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1297 size-full\" src=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win4.png\" alt=\"win4\" width=\"377\" height=\"429\" srcset=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win4.png 377w, https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win4-264x300.png 264w\" sizes=\"auto, (max-width: 377px) 100vw, 377px\" \/><\/a><a href=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/win3.png\"><br \/>\n<\/a><\/li>\n<li>Now we need to enter the location of our GCC compiler. For this, first click the &#8216;New&#8217; button and then type or copy in the location to the compiler.<br \/>\nThe default location is &#8216;C:\\MinGW\\bin&#8217;.<br \/>\nIf you&#8217;re not sure about it, You can look if &#8216;gcc.exe&#8217; is located in that folder or search for it in your computer.<em><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2871\" src=\"http:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/gcc.png\" alt=\"gcc\" width=\"525\" height=\"502\" srcset=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/gcc.png 525w, https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2015\/07\/gcc-300x287.png 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/em><\/li>\n<li>Now confirm all the changes we made and test if we were successful. For this, we can just start the console (command prompt) and see if the compiler will be found (run &#8216;gcc &#8211;version&#8217; for an example) or use Geany to compile Your first program on Your computer.<br \/>\n<a href=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2020\/08\/gcc.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5255 size-full\" src=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2020\/08\/gcc.png\" alt=\"\" width=\"626\" height=\"210\" srcset=\"https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2020\/08\/gcc.png 626w, https:\/\/blue.pri.ee\/ttu\/wp-content\/uploads\/2020\/08\/gcc-300x101.png 300w\" sizes=\"auto, (max-width: 626px) 100vw, 626px\" \/><\/a><\/li>\n<\/ol>\n<p><strong>Common issues:<\/strong><\/p>\n<ol>\n<li>If in the end of the tutorial you can&#8217;t see GCC version, then you have missed a step in the installation process<\/li>\n<li>If some of the screenshots don&#8217;t match, it&#8217;s because Windows 10 changes how things look and where they are hidden twice a year. Due to constant changes variety of builds that are still considered &#8220;latest&#8221;, it is impossible to\u00a0 have a single Windows 10 guide. The required pages and options should still be named and placed similarly.<\/li>\n<li>If you try to compile your first program, but it fails, it&#8217;s likely blocked by the antivirus software you have on your computer. Check what components and folders need to be whitelisted and how the antivirus software needs to be configured to allow for compiling programs. This is dependent on your particular configuration and antivirus software.<\/li>\n<\/ol>\n<\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This page describes different methods for installing Geany and the compiler on your computer. Once finished, go and read how to configure Geany to make it more useful for you and check out a few hints on using it. Guide: Geany configuration and usage.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":6934,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"page-templates\/code-width.php","meta":{"footnotes":""},"class_list":["post-1542","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/pages\/1542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/comments?post=1542"}],"version-history":[{"count":5,"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/pages\/1542\/revisions"}],"predecessor-version":[{"id":9544,"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/pages\/1542\/revisions\/9544"}],"up":[{"embeddable":true,"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/pages\/6934"}],"wp:attachment":[{"href":"https:\/\/blue.pri.ee\/ttu\/wp-json\/wp\/v2\/media?parent=1542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}