{"id":57,"date":"2022-11-12T09:33:19","date_gmt":"2022-11-12T16:33:19","guid":{"rendered":"https:\/\/blog.nrezinorn.net\/?p=57"},"modified":"2022-12-05T16:38:21","modified_gmt":"2022-12-05T23:38:21","slug":"my-build-environments-part-1","status":"publish","type":"post","link":"https:\/\/blog.nrezinorn.net\/index.php\/2022\/11\/12\/my-build-environments-part-1\/","title":{"rendered":"My Build Environments &#8211; Part 1"},"content":{"rendered":"\n<p>The most common question I see on the internet is usually &#8220;how do I set my environment up&#8221;, This question usually is asked from someone using a Windows OS.  It is a fair question to ask, and before VSCode, there was not a very obvious answer (IMO).  Thankfully its 2022 now, and there&#8217;s plenty of options &#8211; these are how my Build environments are setup.<\/p>\n\n\n\n<p><strong>Windows<\/strong><\/p>\n\n\n\n<p>My windows setup is simple to manage, as 90-95% of it is handled for me with <a href=\"https:\/\/www.msys2.org\/\">MSYS2<\/a> .  It might be &#8220;cheating&#8221; but I found in the past having to manage all your libraries and header files across a bunch of folders on windows is  a &#8220;bad time&#8221;.<\/p>\n\n\n\n<p>Steps to get going are:<br><code>Install MSYS2<br>Install Compiler<br>install Libraries (SDL2, Vulkan, etc)<br>Setup Environment Variables<\/code><\/p>\n\n\n\n<p>Once you have MSYS2 install, use pacman to install the remaining items you want\/need, I use the following packages for my SDL\/OPENGL projects:<br><code># Compiler<br>mingw-w64-x86_64-gcc<br>mingw-w64-x86_64-gdb<br># Libraries<br>mingw-w64-x86_64-SDL<br>mingw-w64-x86_64-SDL2<br>mingw-w64-x86_64-SDL2_image<br>mingw-w64-x86_64-SDL2_mixer<br>mingw-w64-x86_64-SDL2_ttf<br>mingw-w64-x86_64-freetype<br>mingw-w64-x86_64-vulkan-headers<\/code><\/p>\n\n\n\n<p>To Setup your Environment Variables search for &#8220;Edit Environment Variables for your Account&#8221;  in the start menu and set the following variables (as your user or SYSTEM level.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"468\" height=\"124\" src=\"https:\/\/blog.nrezinorn.net\/wp-content\/uploads\/2022\/11\/dev_compiler_env75.jpg\" alt=\"\" class=\"wp-image-63\" srcset=\"https:\/\/blog.nrezinorn.net\/wp-content\/uploads\/2022\/11\/dev_compiler_env75.jpg 468w, https:\/\/blog.nrezinorn.net\/wp-content\/uploads\/2022\/11\/dev_compiler_env75-300x79.jpg 300w\" sizes=\"auto, (max-width: 468px) 100vw, 468px\" \/><\/figure>\n\n\n\n<p>With those all set you should be able to start using gcc either manually in a terminal, or though VSCode.<\/p>\n\n\n\n<p><strong>Mac<\/strong><\/p>\n\n\n\n<p>My Mac build environment is simpler due to OS X providing us a compiler already (we have to install it, but it&#8217;s there).   The high level view looks like this:<br><code>Install XCode + CLI tools (git)<br>Install Frameworks (SDL2, SDL2_Mixer)<br>Install Brew<br>Install Freetype Library<\/code><\/p>\n\n\n\n<p>To install XCode you can go to AppStore and install &#8220;development tools&#8221;.  After going to the SDL2 website and grabbing the OSX files, I copy them to \/Library\/Frameworks\/ rather than my home Library folder.  I wont go over how to install <a href=\"https:\/\/brew.sh\/\">Brew <\/a>here, but once you have it you can <code>brew install freetype2<\/code><\/p>\n\n\n\n<p><strong>Linux<\/strong><\/p>\n\n\n\n<p>On Linux, I use the local package manager to install gcc, gdb, and all the -devel packages for SDL2 , etc.  Search the package manager if you cannot find the names for your Distro.  It is the easiest and quickest to setup and get building.  <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The most common question I see on the internet is usually &#8220;how do I set my environment up&#8221;, This question usually is asked from someone using a Windows OS. It is a fair question to ask, and before VSCode, there was not a very obvious answer (IMO). Thankfully its 2022 now, and there&#8217;s plenty of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[9,10],"class_list":["post-57","post","type-post","status-publish","format-standard","hentry","category-general","tag-vscode","tag-windows"],"_links":{"self":[{"href":"https:\/\/blog.nrezinorn.net\/index.php\/wp-json\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nrezinorn.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nrezinorn.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nrezinorn.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nrezinorn.net\/index.php\/wp-json\/wp\/v2\/comments?post=57"}],"version-history":[{"count":4,"href":"https:\/\/blog.nrezinorn.net\/index.php\/wp-json\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":64,"href":"https:\/\/blog.nrezinorn.net\/index.php\/wp-json\/wp\/v2\/posts\/57\/revisions\/64"}],"wp:attachment":[{"href":"https:\/\/blog.nrezinorn.net\/index.php\/wp-json\/wp\/v2\/media?parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nrezinorn.net\/index.php\/wp-json\/wp\/v2\/categories?post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nrezinorn.net\/index.php\/wp-json\/wp\/v2\/tags?post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}