You are not logged in.
Hi everybody,
I'm trying to compile a simple rtnetlink example written in c using gcc [ver 4.7.2] but I get this error :
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
and here is the include parts of example :
#include <sys/socket.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <arpa/inet.h>
#include <unistd.h>
Should I add a specific library or something ?! (I tried netlink and pthreads libraries and it didn't work)
thanks in advance
Last edited by bahramwhh (2012-10-09 09:34:56)
Offline
@bahramwhh We'll need to complete source code and the exact compiler and link invocation to help you.
Offline
@lunar oh, I'm sorry, my problem solved. my file didn't have the main function !
Last edited by bahramwhh (2012-10-09 09:35:29)
Offline