How to check internet availability in C ++
I wrote one small function to check the internet connection availability.
void cis()
{
if(InternetCheckConnection(NULL,FLAG_ICC_FORCE_CONNECTION,0))
{
cout << "internet alive";
}
}
I am using WinInet.h
for InternetCheckConnection()
. Now the problem is that I am getting the following linker error:
[Linker error] undefined reference to `_imp__InternetCheckConnectionA@12'
I am using DevC ++ for my project. Any ideas on how to fix this linker issue or any other ideas for checking an active internet connection?
+3
source to share