🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #1799

Re: console ping example

#1799
From: DeKayA
Date: Sun, 29 Oct 2006 15:35
37 lines
2159 bytes
On Sun, 29 Oct 2006 13:30:30 GMT, DeKayA@bellsouth.net wrote:

>The error is [Linker Error]Unresolved external'_main' referenced from
>C:\BCB4\LIB\C0X32.OBJ

Somewhere on the web someone else was dealing with something kind of
similar.  a users suggested,"Add an empty main function to MustWork.c"
void main( int i, char** c )
{
} 

Well I tried that and it compiled, but not at all what I expected.
It was just jumping right to the empty main and compiling that.  

That gave me an idea. I threw out the empty main and renamed WinMain
to main.  Voila;  It worked.


Perhaps I started the project wrong in BCB4.
I selected New\Consoile Wizard. Is that wrong for a plain console App?

I would like to provide it with an IP address or computer name on my
local net instead of the "WWW.Microsoft.com"

I notice it return an address but it is not in standard format
i.e.  for microsoft it was 001531d8.

a standard ping returns [207.46.130.108]
while tracert to www.microsoft.com brings this up 
tracing route to lb1.www.ms.akadns.net [207.46.198.30]  


I know this program uses the function 
  phostent = gethostbyaddr((char *)&d,4,PF_INET);
But how would you convert  192.168.1.3 to ?

anyway  Thanks a lot
Technical Details
Message-ID: <4544b397.5344785@forums.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45440dc2.34466740@forums.borland.com> <4544818b$1@newsgroups.borland.com> <4544a862.2476000@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,31ea45a742d03588
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: DeKayA@bellsouth.net
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: console ping example
Date: Sun, 29 Oct 2006 15:35:10 GMT
Message-ID: <4544b397.5344785@forums.borland.com>
References: <45440dc2.34466740@forums.borland.com> <4544818b$1@newsgroups.borland.com> <4544a862.2476000@forums.borland.com>
X-Newsreader: Forte Agent 1.5/32.452
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 72.153.143.202
X-Trace: newsgroups.borland.com 1162136181 72.153.143.202 (29 Oct 2006 07:36:21 -0700)
Lines: 39
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail