Overview
Features
Download
Documentation
Community
Add-Ons & Services

[SOLVED]POCO Net samples - Ping question

Please post support and help requests here.

[SOLVED]POCO Net samples - Ping question

Postby panovr » 19 Apr 2012, 14:29

I compiled POCO with default configuration under Windows 7, Visual Studio 2010.

1. Then I cd into "F:\lib\poco-1.4.3p1\Net\samples\Ping\bin\static_mt", and execute "Ping.exe", but got this result:

Code: Select all
F:\lib\poco-1.4.3p1\Net\samples\Ping\bin\static_mt>Ping
I/O error: Permission denied


What the reason for this result?

2. I open the "Property" window of the Ping project, in the "Input" of the "Linkage" window, I only find that it linked with "ws2_32.lib"
and "iphlpapi.lib", but without any POCO libraries.

I just wonder how Ping project linked with POCO libraries?
Last edited by panovr on 01 May 2012, 15:29, edited 1 time in total.
panovr
 
Posts: 11
Joined: 18 Apr 2012, 16:23

Re: POCO Net samples - Ping question

Postby fbraem » 19 Apr 2012, 16:30

You are pinging to localhost and this gives you the Permission Denied error.

In VC++ libraries are automatically linked. For example you find this in Foundation.h:

Code: Select all
#if defined(_MSC_VER)
   #if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Foundation_EXPORTS)
      #pragma comment(lib, "PocoFoundation" POCO_LIB_SUFFIX)
   #endif
#endif
Zumuta!, that's the way to do IT!
fbraem
 
Posts: 96
Joined: 11 Aug 2008, 22:47
Location: Belgium

Re: POCO Net samples - Ping question

Postby panovr » 20 Apr 2012, 09:02

fbraem wrote:You are pinging to localhost and this gives you the Permission Denied error.


However, I find this in "Ping.cpp":
Code: Select all
Ping():
      _helpRequested(false),
      _icmpClient(IPAddress::IPv4),
      _repetitions(4),
      _target("localhost")
   {
   }

If I understand correctly, it support to ping "localhost".

Also, if I use the command, there is also an error:
Code: Select all
F:\lib\poco-1.4.3p1\Net\samples\Ping\bin\static_md>Ping /target=www.google.com
I/O error: Permission denied


fbraem wrote:In VC++ libraries are automatically linked. For example you find this in Foundation.h:

Code: Select all
#if defined(_MSC_VER)
   #if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Foundation_EXPORTS)
      #pragma comment(lib, "PocoFoundation" POCO_LIB_SUFFIX)
   #endif
#endif


Thanks for this tip, now I know if I include "Foundation.h", then the application will linked POCO library automatically in MSVC environment.
panovr
 
Posts: 11
Joined: 18 Apr 2012, 16:23


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron