LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-03-2008, 08:59 AM   #1
rohit83.ken
LQ Newbie
 
Registered: Dec 2007
Posts: 18

Rep: Reputation: 0
Smile cant include libipq.h header file


I have a C file of the following .When I execute this in Fedora 7 version 2.6.21-1.3194.fc7 and
arch =i686 I get following errors

[root@kwi-11156f06184 Desktop]# cc test.c
test.c:3:20: error: libipq.h: No such file or directory
test.c: In function ‘main’:
test.c:12: error: ‘PF_INET’ undeclared (first use in this function)
test.c:12: error: (Each undeclared identifier is reported only once
test.c:12: error: for each function it appears in.)
test.c:12: warning: assignment makes pointer from integer without a cast

[root@kwi-11156f06184 Desktop]# cc test.c -libipq.h
test.c:3:20: error: libipq.h: No such file or directory
test.c: In function ‘main’:
test.c:12: error: ‘PF_INET’ undeclared (first use in this function)
test.c:12: error: (Each undeclared identifier is reported only once
test.c:12: error: for each function it appears in.)
test.c:12: warning: assignment makes pointer from integer without a cast

[root@kwi-11156f06184 Desktop]# cc test.c -libipq
test.c:3:20: error: libipq.h: No such file or directory
test.c: In function ‘main’:
test.c:12: error: ‘PF_INET’ undeclared (first use in this function)
test.c:12: error: (Each undeclared identifier is reported only once
test.c:12: error: for each function it appears in.)
test.c:12: warning: assignment makes pointer from integer without a cast

[root@kwi-11156f06184 Desktop]# cc -libipq test.c
test.c:3:20: error: libipq.h: No such file or directory
test.c: In function ‘main’:
test.c:12: error: ‘PF_INET’ undeclared (first use in this function)
test.c:12: error: (Each undeclared identifier is reported only once
test.c:12: error: for each function it appears in.)
test.c:12: warning: assignment makes pointer from integer without a cast

Code:
/* c file called test.c*/

#include <linux/netfilter.h>
#include <libipq.h>
#include <stdio.h>

int main()
{
  int retVal = 0;
  char buf[1000];
  struct ipq_handle* userHandle;

  userHandle = ipq_create_handle(0, PF_INET);
  if(userHandle == NULL)
  {
    printf("ipq_create_handle returned error\n");
    return -1;
  }

  retVal = ipq_read(userHandle, buf, 1000, 0);

  return 0;
}
my problem is how shall I include all these header files , so that my program works

any hints and suggestions
prethanks to helper
 
Old 04-03-2008, 11:19 AM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by rohit83.ken View Post
my problem is how shall I include all these header files , so that my program works

any hints and suggestions
Yes—install the development package for libipq.
 
Old 04-04-2008, 01:45 AM   #3
rohit83.ken
LQ Newbie
 
Registered: Dec 2007
Posts: 18

Original Poster
Rep: Reputation: 0
how can i install that package

but the thing is how and where hall I install the libipq.h header files
shall I use add/remove software to do that in fedora 7
or shall I use yum to install it
 
Old 04-04-2008, 01:53 AM   #4
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
You could use the add/remove feature if it was available if not then yum may be your best bet.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to include header file.. nick021 Programming 2 05-05-2006 03:11 PM
Include Custom Header Kenji Miyamoto Programming 3 01-13-2005 08:46 PM
header include path KDE4me Linux - Newbie 6 01-06-2005 06:17 AM
Clarifiacation on header file "/usr/include/a.out.h" swathisat Linux - Software 0 09-05-2003 12:12 AM
need perl fuction like c #include statement for header file mrtwice Programming 5 06-19-2003 02:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration