1

I'm making an application based on networking. The first thing it should do is check if the user has an internet connection.For this I tried using functions given in header like (InternetCheckConnection & ConnectionStat) but whenever I try to compile I get errors similar to this one => reference to `InternetCheckConnectionA@12' so I tried to change compiler (from devc++ to Code::Blocks) but the same problem...

Is there another way to check for internet connection with c?

Kara
  • 6,115
  • 16
  • 50
  • 57
  • [ping.c](http://www.google.com) – Grijesh Chauhan Jul 19 '13 at 15:08
  • 9
    "How to check internet connection with C?" - You look at the cable and C if it's plugged in. –  Jul 19 '13 at 15:08
  • 1
    [http://stackoverflow.com/questions/15778404/programmatically-check-whether-my-machine-has-internet-access-or-not](http://stackoverflow.com/questions/15778404/programmatically-check-whether-my-machine-has-internet-access-or-not) – Chris Cooper Jul 19 '13 at 15:12
  • 1
    "How to check internet connection with C" and question is marked with C++? **C++ is not C!!!** – Manu343726 Jul 19 '13 at 15:13
  • 2
    Why not just try to connect to whatever you want to get to on the internet and then handle it if you can't get there? – cmd Jul 19 '13 at 15:18
  • What platform do you need to do it on? Windows? Linux? OSX? iOS? Android NDK? – Pete Jul 19 '13 at 15:25
  • Also where does inetnetCheckConnection come from? If you have unresolved externals you probably forgot to link a library into your executable. – Pete Jul 19 '13 at 15:26

1 Answers1

0

InetnetCheckConnection causes linking error because you probably(certainly) didn't link Wininet.lib http://msdn.microsoft.com/en-us/library/windows/desktop/aa384346%28v=vs.85%29.aspx

Matteo Umili
  • 3,412
  • 1
  • 19
  • 31