View previous topic :: View next topic |
Author |
Message |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8018 Location: Salford, UK
|
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2866 Location: South Pole, Antarctica
|
Posted: Wed Nov 02, 2022 11:51 pm Post subject: |
|
|
Changed my clrwin.f95 to your latest from Demo1 project above. Previous errors in the example posted in the other thread disappeared but new one appeared
Code: | Compiling file clrwin.f95 using gFortran.
Compilation completed with no errors.
Linking...
c:/users/rigt/gcc/bin/../lib/gcc/x86_64-w64-mingw32/13.0.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/users/rigt/gcc/bin/../lib/gcc/x86_64-w64-mingw32/13.0.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x2e): undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
Linking completed.
|
Compiling this file in a batch file instead of Plato though works ok.
Today's Demo1 project compiles by Plato OK
Would be also helpful if you showed your own settings for Intel compiler. Intel compilers of course could be different but having few examples for different versions is better than crawling in total darkness searching where the heck it could be due to the now uncleanable mess of Intel with Microsoft VS. Users sharing their experience on how to install Intel OneAPI Fortran would also help. I failed to install it last year and this year. Intel Fortran community is lying face down in the mud lately and is totally clueless. Some of their major "gurus" are capable to give just the general advices a la "make clean install", "clean registry", "unregister dll", "check the path" every cat and dog knows though themselves never did these clean installs because even have no Windows computer
Settings and installation of gFortran is straightforward and easy. In my case the path is C:\Users\DanRRight\gcc\bin and in the field "gFortran Compiler" - gFortran.exe
Last edited by DanRRight on Thu Nov 03, 2022 4:27 am; edited 4 times in total |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Thu Nov 03, 2022 1:56 am Post subject: |
|
|
Most compilers, including Gfortran but not FTN95, when given just a Fortran source file name as argument, will attempt to link after compiling. You need to add the -c option if you want to prevent linking.
Even when you forgot to specify -c and Gfortran attempted to link, the object file would still have been produced, so you can continue with the next build step. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2866 Location: South Pole, Antarctica
|
Posted: Thu Nov 03, 2022 6:37 pm Post subject: |
|
|
With Demo1 project we have no problems now. They were due to differences in clrwin.f95. After Paul updated clrwin.f95 and other library files sent together in Demo1.zip, this works OK at least with gFortran and FTN95. I have not tried Intel iFort/OneAPI which i can not yet set as an option for third-party compilers because it refuses to install with unknown reasons, i guess 99.999% because of conflict with Microsoft Visual Studio Intel shamelessly pushes users to use with Windows version of Intel Fortran but has no expertise or manpower to handle potential conflicts |
|
Back to top |
|
|
|