0

我正在尝试运行一个 C++ 项目,但我收到此“无效的主机字符串:localhost”错误。

这是我的 /ect/hosts 文件:

##
# 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

即使,我仍然收到错误。提前致谢。

4

1 回答 1

0

我也有同样的问题。

我在网上找到了这些对其他人有用的解决方案,也许它对你有用。

链接: http ://ubuntuforums.org/showthread.php?t=1896148

https://superuser.com/questions/354902/etc-hosts-getting-reset-in-lion/379560#379560

如果其他人有其他建议,我也会全神贯注,因为我仍然面临同样的问题。


编辑:

我找到了解决问题的方法。我的主机文件保存为 .rtf 文件,而不是 .txt 格式。在我进行更正后,一切正常。也许这会对你有所帮助。祝你好运!

于 2012-10-29T19:39:48.300 回答