I am trying to run in command line tool the following code:
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
// insert code here...
NSLog(@"Hello, World!");
}
return 0;
}
and after "Build Succeeded" I am getting the following error:
error: failed to launch '/Users/dimitrisagagiotis/Library/Developer/Xcode/DerivedData/test-guvgymeaqzlsheascqbmllxdtpsn/Build/Products/Debug/test' -- invalid host string: 'localhost'
any solution??? Thank you
I had the same issue and resolved it with the following steps.
/etc/hosts
file127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost
dscacheutil -flushcache
to reload the DNS configurationI have absolutely no idea how it was possible to get a host file without the loopback DNS entries to localhost. From this point of view, "invalid host string: 'localhost'" is pretty self-describing: localhost is a invalid host string to the system, it simply can not resolve localhost.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With