User forums > Help

Problems with fortran compiler

<< < (2/3) > >>

oBFusCATed:
Yes, but you have to select the fortran compiler in the project settings.
In the log you can see that C::B is using the GCC compiler.

Rfernandez:
I didn´t know that I had to change the project settings, after changing the settings in code blocks main bar. Thanks for the tip!
I changed already the project settings and only an error appeared:

-------------- Build: Debug in pruebaFor (compiler: G95 Fortran Compiler)---------------

mingw32-gfortran.exe -fmod=obj\Debug\ -Wall  -g     -c "C:\Users\Ricardo Fernández\Desktop\2 INININ\Simulador\Prototipo\Programacion\pruebaFor\main.f95" -o obj\Debug\main.o
mingw32-gfortran.exe: error: unrecognized command line option '-fmod=obj\Debug\'
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))

I don´t know how to correct this error, could you help please?
Thanks
Ricardo

standegroff:
I have the same problem.  I don't know what I'm doing....
I used the self installing files, installed codeblocks ming 17.12 with gcc, then the one with gfortran.  I have played with settings but it continues to want to use GCC compiler.  Where are these settings ?  I have tried using fortran on and off for the last couple years and have not gotten past this point.

The errors on the demo first program are "Undefined reference to  '_gfortran_transfer_character_write'.
It obviously is stuck on GCC even when I set it to gcc fortran as default compiler.  gfortran.exe is in the "C:\Program Files (x86)\CodeBlocks\MinGW\bin" directory which I believe is correct.

BentL:
You need to configure your Fortran project properly. The best way to start a new Fortran project is to use the "Fortran application" template:

File > New > Project... > Projects > Fortran application > Go

This way all necessary settings needed for a Fortran project are applied.

But you can also manually set these settings.


1) First set the compiler:

File > Settings... > Compiler... > Global compiler settings > Selected compiler: GNU Fortran Compiler

Then the toolchain:

File > Settings... > Compiler... > Global compiler settings > Toolchain executables > Program files

with the settings:

C compiler: mingw32-gfortran.exe
C++ compiler: mingw32-gfortran.exe
Linker for dynamic libs: mingw32-gfortran.exe
Linker for static libs: ar.exe
Debugger: GDB/CDB debugger : default
Resource compiler: windres.exe
Make program: mingw32-make.exe


2) Next you can configure the debugger:

Settings > Debugger... > GDB/CDB debugger > Default > Executable path > C:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb32.exe

and select GDB as debugger.


3) Next you can specify that all libraries should be statically linked to the exe-file, so the application contains just one file:

File > Project > Build options... > Select application name > Linker settings > Other linker options > -static


4) Finally, you need to update the file "libgfortran-3.dll" as described in this post in order to work with files.

standegroff:
Thanks, I appreciate the details.  I will try it.
Interesting though ...
I have another Win 7 machine 32 bit (company owned and secured)  It is running 13.12 and will compile C++ source.
The one I'm having problems with is a 64 bit Win 10 running 17.xx codeblocks.  It will not compile C++ either !!! It is secured and owned by the company.
I think I have some security issues.

Another thing, The older machine shows codeblocks in the "Programs and Features" screen.  The Win 10 machine does not show it.  and I can't uninstall. "Programfiles(x86)\codeblocks" can't delete.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version