![]() |
| | #1 |
| Registered User Join Date: Oct 2007
Posts: 6
| 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;
}
any hints and suggestions prethanks to helper |
| rohit83.ken is offline | |
| | #2 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,710
| Well the first thing you should do is stop writing and compiling programs (and presumably browsing the web) as root. Sooner or later, you'll be wondering where your install disks are because you've either trashed the system or someones hacked it. As for running the compiler, it would be something like cc -I/path/to/header test.c The -I parameter specifies a location where header files may be found, in addition to the usual places. Or it may simply be that you haven't installed that library. |
| Salem is offline | |
| | #3 |
| Registered User Join Date: Oct 2007
Posts: 6
| how shall i install that library shall I use yum or add/remove software in fedora 7 |
| rohit83.ken is offline | |
| | #4 | |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| Quote:
-- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. | |
| matsp is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Checking array for string | Ayreon | C Programming | 87 | 03-09-2009 03:25 PM |
| Need help understanding Header Files | Kaidao | C++ Programming | 11 | 03-25-2008 10:02 AM |
| Post... | maxorator | C++ Programming | 12 | 10-11-2005 08:39 AM |
| MS Visual C++ 6 wont include vector.h in a header file | bardsley99 | C++ Programming | 9 | 11-06-2003 12:05 PM |