Fatal error: No line with moleculetype 'SOL' found the [ molecules ] section of file 'complex.top'

GROMACS version: version 2021.4-Ubuntu-2021.4-2
GROMACS modification: Yes/No
Hello everyone i’m a new user on GROMACS and i’ve been trying my hands on ligand-protein complex. i’ve gotten to the point i balance the charges in my system after ions addition. the prompt after selecting SOL issues a fatal errorr; Fatal error: No line with moleculetype ‘SOL’ found the [ molecules ] section of file ‘complex.top’. I would be grateful if anyone could show me how to resolve this. FYI my GROMACS is compiles in a Linux compartment and i run it from a WSL on my windows computer. here’s the relevant part of my complex.top file that has the SOL

; Include Position restraint file
#ifdef POSRES
#include “posre.itp”
#endif

; Include water topology
#include “charmm36.ff/tip3p.itp”

#ifdef POSRES_WATER
; Position restraint for each water oxygen
[ position_restraints ]
; i funct fcx fcy fcz
1 1 1000 1000 1000
#endif

; Include topology for ions
#include “charmm36.ff/ions.itp”

[ system ]
; Name
Protein

[ molecules ]
; Compound #mols
Protein_chain_A 1
lig 1
SOL 32661

here’s the command together with user inputs that generated this error

gmx genion -s ions.tpr -o solv_ions.gro -p complex.top -pname NA -nname CL -neutral

Reading file ions.tpr, VERSION 2021.4-Ubuntu-2021.4-2 (single precision)
Reading file ions.tpr, VERSION 2021.4-Ubuntu-2021.4-2 (single precision)
Will try to add 31 NA ions and 0 CL ions.
Select a continuous group of solvent molecules
Group 0 ( System) has 109084 elements
Group 1 ( Protein) has 11035 elements
Group 2 ( Protein-H) has 5530 elements
Group 3 ( C-alpha) has 718 elements
Group 4 ( Backbone) has 2154 elements
Group 5 ( MainChain) has 2871 elements
Group 6 ( MainChain+Cb) has 3535 elements
Group 7 ( MainChain+H) has 3555 elements
Group 8 ( SideChain) has 7480 elements
Group 9 ( SideChain-H) has 2659 elements
Group 10 ( Prot-Masses) has 11035 elements
Group 11 ( non-Protein) has 98049 elements
Group 12 ( Other) has 66 elements
Group 13 ( MOL) has 66 elements
Group 14 ( Water) has 97983 elements
Group 15 ( SOL) has 97983 elements
Group 16 ( non-Water) has 11101 elements
Select a group: 15
Selected 15: ‘SOL’
Number of (3-atomic) solvent molecules: 32661

Processing topology


Program: gmx genion, version 2021.4-Ubuntu-2021.4-2
Source file: src/gromacs/gmxpreprocess/genion.cpp (line 351)

Fatal error:
No line with moleculetype ‘SOL’ found the [ molecules ] section of file
‘complex.top’

There does seem to be a line with SOL in the molecules section. Maybe there is no newline at the end of this line?

thank you for the response. i ran a dos2unix on my complex.top file as jalemkul from thelemkullab.com recommended to another user and it worked.