2

I'm using Git PowerShell to compile Fortran code with gfortran on windows 10.

Recently, I had to restart my computer. When reopened, git asked if I would like to update to the latest version (2.6.2). I accepted. After doing so, I found that my code no longer successfully compiles.

First, I was getting the error

undefined reference to 'WinMain'

From this post, I tried adding the following compiler flag:

FCFLAGS += -Wl,-subsystem,windows

to my list of flags. But now I'm getting this error:

....bj//MOONS_solver.o ./obj//MOONS_main.o ./obj//main.o
gfortran.exe: error: ./o: No such file or directory
make: *** [F:/Property_of_C_Kawczynski/SIMS/Bandaru/Q8/MOONS.exe] Error 1

I'm looking for a solution to the compilation issue, or, if there's an easy way for me to go back to the previous version of Git (which, ironically, I've had a lot of trouble finding any relevant search results), I'm all ears.

halfer
  • 19,824
  • 17
  • 99
  • 186
Charles
  • 947
  • 1
  • 15
  • 39
  • Please, if you downvote, can you explain why so that I can improve my question? Thank you. – Charles Feb 22 '18 at 21:56
  • 1
    It is often recommended to NOT explain downvoting. It leads to revenges too often. Nevertheless, I also do not beleive gitversion can cause any compilation errors. If you want to solve your errors, show a [mcve] and all other details necessary to replicate the problem. – Vladimir F Героям слава Feb 22 '18 at 22:21
  • I agree, it seems absurd. Yet, I don't know what else to do aside from describe what happened. I'm shocked that I saw this error in the first place. Honestly, I believe Murphy's law best explains what's going on. My Ph.D. defense is coming up, so I'm not surprised that an error magically started appearing when I compile my code. – Charles Feb 22 '18 at 22:24
  • Check that you are on the correct branch, checkout the last commit again. If the error persists continue in the usual debugging steps you do in programming. – Vladimir F Героям слава Feb 22 '18 at 22:32
  • Thanks @Vladimir F, that's good advice. – Charles Feb 22 '18 at 22:34

1 Answers1

2

if there's an easy way for me to go back to the previous version of git

Yes, with Git for Windows, you can have as many version of Git you need.
Simply uncompress the portable version (like PortableGit-2.16.1.4-64-bit.7z.exe) anywhere you want, and setup a simplified PATH to test it out.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I think that this is very helpful advice, thank you. Unfortunately, I didn’t have time to test this out. If I get around to trying a different version then I’ll accept this answer. Thanks again! – Charles Mar 19 '18 at 04:27
  • @Charlie No problem: the all idea is to uncompress an archive anywhere you want, and modify a PATH in a *locall* shell session: nothing will be modified on your computer. – VonC Mar 19 '18 at 05:28