1

I have taken up few challenges on codechef and the code is giving correct output in local system and not on codechef. I found out the reason of this behavior was compiler difference. Different outputs compiler wise. Can anyone please tell me the steps to change the compiler in my IDE? so that whatever I code is synchronized with all my competitive programing challenges.

Stuti
  • 57
  • 1
  • 6
  • @Ron, I am donw with basics contained in the books, looking a way to implement logics through challenges... – Stuti May 25 '20 at 22:42
  • Side note: When the program behaves differently with different compilers either the language changed or you have a bug in your code. The bug is the more likely candidate. – user4581301 May 25 '20 at 23:26

1 Answers1

1

You have to install the compiler you want to use then link the path of it in the IDE https://medium.com/@yzhong.cs/code-blocks-compile-64-bit-under-windows-with-mingw-w64-79101f5bbc02

dyrod
  • 56
  • 4
  • This is a link-only answer. It will become useless when the link rots. You can fix this by summarizing the content of the link. – user4581301 May 25 '20 at 23:32
  • This link does not cover how do I download and install compiler, on the download page for any GNU compiler, there are various options such as gz, gz.sig, xz, xz.sig, tar, diff, etc. Can anone please help me on the same ? – Stuti May 26 '20 at 06:33
  • @Stuti The link I provided shows you how you can install any compiler. You can also download a codeblocks installer with a MinGW's GNU GCC compiler and GNU GDB debugger. You may have to link the path of the debugger in the Settings-> Debugger option. You can choose between prev installed compilers in the Settings -> Compiler menu from the very first drop-down list "Selected compiler". Here is a link of the supported compilers http://wiki.codeblocks.org/index.php/Installing_a_supported_compiler – dyrod May 26 '20 at 07:31
  • @Stuti [Good instructions for installing one of the better MinGW distributions](https://stackoverflow.com/questions/30069830/how-to-install-mingw-w64-and-msys2). MSYS2 will set you up with up-to-date compilers and a large ecosystem of tools and pre-built libraries. – user4581301 May 26 '20 at 14:52