I’m trying to run a C++ project, but I get this “invalid host string: localhost” error.
here is my /ect/hosts file:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
Even though, I’m still getting the error. Thanks in advance.
I have the same problem.
I have found these solutions online that worked for other people, maybe it will work for you.
Link:
http://ubuntuforums.org/showthread.php?t=1896148
https://superuser.com/questions/354902/etc-hosts-getting-reset-in-lion/379560#379560
If anyone else has another other suggestions, I am all ears too because I am still facing this exact same issue.
Edit:
I found my solution to the issue. My host file was saved as a .rtf file instead of .txt format. After I made the correction, everything worked. Maybe this will help you. Good luck!