Author Topic: Can't build my codes  (Read 4111 times)

Offline Jason Killjoy

  • Single posting newcomer
  • *
  • Posts: 3
Can't build my codes
« on: March 20, 2017, 01:14:51 pm »
Hi everyone, I'm having some troubles in setting up the compiler for codeblocks, so I figured you could maybe help me.
I'm using windows 10 64 bit and I'm new with fortran, so I wanted to get all at once and download codeblocks with the compiler, so I downloaded codeblocks-16.01mingw-setup.exe from http://codeblocks.org/downloads/binaries.

I installed it in D:\CodeBlocks, but when I opened it an Environmental Error poped-up: "Can't find compiler executable in your configured search path's for GNU GCC Compiler". So I went to settings-->compiler and in toolchain executables I auto-detected it in D:\CodeBlocks\MinGW. So I started a new project-->fortran application and, apart from the name, I just nexted everything (I made sure the compiler was GNU GCC Compiler). So I then had my main.f95 that showed "Hello World!", but when I went to build it I had an error:

                                  === Build: Debug in test (compiler: GNU GCC Compiler) ===
CreateProcess           No such file or directory
                                 === Build failed: 1 error(s), 0 warning(s)  (0 minute(s), 0 second(s)) ===

So I tried to reinstall it in C:\Program Files (x86)\Codeblocks and in C:\Program Files\Codeblocks, I repeated the same exact procedure and nothing changed.

What am I doing wrong?

Offline sodev

  • Regular
  • ***
  • Posts: 497
Re: Can't build my codes
« Reply #1 on: March 20, 2017, 02:32:00 pm »
The bundled MinGW contains only a C/C++ compiler, you need to download a version with a Fortran compiler yourself.

Offline Jason Killjoy

  • Single posting newcomer
  • *
  • Posts: 3
Re: Can't build my codes
« Reply #2 on: March 20, 2017, 07:41:23 pm »
Thank you for your answer, but I don't understand how can that be. Quoting from their website:
"MinGW includes:

        A port of the GNU Compiler Collection (GCC), including C, C++, ADA and Fortran compilers;"

Is the one included in codeblocks' download a different one? And if so, then I should download a Fortran compiler and make what changes in Codeblocks-->settings-->compiler ?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Can't build my codes
« Reply #3 on: March 20, 2017, 07:54:00 pm »
Thank you for your answer, but I don't understand how can that be. Quoting from their website:
"MinGW includes:

        A port of the GNU Compiler Collection (GCC), including C, C++, ADA and Fortran compilers;"

Is the one included in codeblocks' download a different one? And if so, then I should download a Fortran compiler and make what changes in Codeblocks-->settings-->compiler ?

I SUGGEST YOU TRY THE ONE WITH FORTRAN in the installer name!

Code
codeblocks-16.01mingw_fortran-setup.exe

FROM http://codeblocks.org/downloads/binaries
Quote
NOTE: The codeblocks-16.01-setup.exe file includes Code::Blocks with all plugins. The codeblocks-16.01-setup-nonadmin.exe file is provided for convenience to users that do not have administrator rights on their machine(s).

NOTE: The codeblocks-16.01mingw-setup.exe file includes additionally the GCC/G++ compiler and GDB debugger from TDM-GCC (version 4.9.2, 32 bit, SJLJ). The codeblocks-16.01mingw_fortran-setup.exe file includes additionally to that the GFortran compiler (TDM-GCC).

NOTE: The codeblocks-16.01(mingw)-nosetup.zip files are provided for convenience to users that are allergic against installers. However, it will not allow to select plugins / features to install (it includes everything) and not create any menu shortcuts. For the "installation" you are on your own.

Tim S.
« Last Edit: March 20, 2017, 07:56:22 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jason Killjoy

  • Single posting newcomer
  • *
  • Posts: 3
Re: Can't build my codes
« Reply #4 on: March 20, 2017, 09:29:10 pm »
Thank you Tim, you are right, I just assumed it was the nonadmin version with mingw and didn't even bother to read the name.

I installed it, set GNU Fortran Compiler as my default one and it all worked.

Thank you again :)