Advertisement

05.19.2001 at 01:28AM PDT, ID: 20120756
[x]
Attachment Details

Borland C++ Builder missing C socket lib??

Asked by totsubo in C Programming Language, Microsoft Visual C++

Tags: borland

I'm trying to compile a rather simple C program under Borlan'd C++ Builder 4 but it's not working. It can't find some libraries, mostly socket related ones. How can I fix this? (Yes, I want to program in C and not C++).

Here are the includes that can't be found

#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>

totsubo

Here's the full code if it helps:

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>

void usage(char *s)
{
 printf("\n(c)2000 Marc Blumenauer <mob@system-security.net>\n\n");
 printf("%s <start_ip> <end_ip> <port>\n",s);
 printf("\n");
 exit(1);
}

int main(int argc, char *argv[])
{
 int                sockfd, n, ret;
 struct hostent     *he;
 struct sockaddr_in she_addr;
 int                start,end;
 char               host[100];
 int                x1,x2,x3,port;

 if(argc <= 3)
  usage(argv[0]);

 port = atoi(argv[3]);
 sscanf(argv[1],"%d.%d.%d.%d",&x1,&x2,&x3,&start);
 sprintf(host,"%d.%d.%d.%d",x1,x2,x3,start);
 printf("\nScanning TCP Port %d from <%s> to ",port,host);

 sscanf(argv[2],"%d.%d.%d.%d",&x1,&x2,&x3,&end);
 sprintf(host,"%d.%d.%d.%d",x1,x2,x3,end);
 printf("<%s>\n",host);

 printf("\n");
 for(;start <= end;start++)
 {
  sprintf(host,"%d.%d.%d.%d",x1,x2,x3,start);
  fflush(stdout);
  sockfd=socket(AF_INET,SOCK_STREAM,0);
  bzero((char*)&she_addr,sizeof(she_addr));
  she_addr.sin_family=AF_INET;
  she_addr.sin_port=htons(port);
  she_addr.sin_addr.s_addr = inet_addr(host);
  if((ret=connect(sockfd,&she_addr,sizeof(she_addr)))!=-1)
    printf("\n--> %s\n",host);
  else
    printf(".");
  close(sockfd);
  sleep(1);
 }
 printf("\n");
 return 0;
}

Start Free Trial
[+][-]05.19.2001 at 05:47AM PDT, ID: 6098937

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2001 at 05:51AM PDT, ID: 6098942

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2001 at 05:55AM PDT, ID: 6098953

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2001 at 06:08AM PDT, ID: 6098970

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2001 at 10:51AM PDT, ID: 6099788

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2001 at 10:55AM PDT, ID: 6099789

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2001 at 05:39PM PDT, ID: 6100234

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2001 at 10:02PM PDT, ID: 6100455

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2001 at 11:34PM PDT, ID: 6100517

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2001 at 08:20PM PDT, ID: 6101965

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2001 at 09:21PM PDT, ID: 6102059

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2001 at 06:26AM PDT, ID: 6103342

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2001 at 08:51AM PDT, ID: 6104031

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2001 at 09:08AM PDT, ID: 6104097

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2001 at 09:08AM PDT, ID: 6104098

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2001 at 09:44AM PDT, ID: 6104243

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2001 at 09:48AM PDT, ID: 6104258

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2001 at 04:08AM PDT, ID: 6107070

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2001 at 09:20PM PDT, ID: 6110538

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2001 at 09:28PM PDT, ID: 6110569

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2001 at 09:35PM PDT, ID: 6110592

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.23.2001 at 08:49PM PDT, ID: 6114490

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.23.2001 at 09:09PM PDT, ID: 6114518

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.24.2001 at 01:00AM PDT, ID: 6115001

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.25.2001 at 03:32PM PDT, ID: 6123125

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.02.2001 at 08:53AM PDT, ID: 6148848

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2001 at 06:28AM PDT, ID: 6156111

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.05.2001 at 05:31PM PDT, ID: 6158194

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.06.2001 at 09:26PM PDT, ID: 6162412

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.03.2001 at 07:38AM PDT, ID: 6249017

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.17.2001 at 01:13PM PDT, ID: 6291227

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C Programming Language, Microsoft Visual C++
Tags: borland
Sign Up Now!
Solution Provided By: kulina
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.17.2001 at 07:08PM PDT, ID: 6292034

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2001 at 08:31PM PDT, ID: 6292131

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.26.2001 at 09:52PM PDT, ID: 6427576

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32