help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem with linkage


From: k0mp
Subject: problem with linkage
Date: 16 Apr 2006 10:42:06 -0700
User-agent: G2/0.2

Hi,

I've got a problem to compile my program (on Linux).
It's made up of a library of functions : eth_lib.cc (+ the headers
eth_lib.h and inet_str.h) and a main file test.cc

test.cc has the following includes :
#include <string>
#include <iostream>
#include <vector>
#include "eth_lib.h"

eth_lib.cc has the following includes :
#include "eth_lib.h"

I've written a

#ifndef __eth_lib_h__
#define __eth_lib_h__
...
#endif

in eth_lib.h but it doesn't seem to settle the problem.

In fact, when I do the following command :
g++ test.cc eth_lib.cc -o test

I get :

In file included from eth_lib.h:14,
                 from test.cc:4:
/usr/include/linux/socket.h:7:2: warning: #warning "You should include
<sys/socket.h>. This time I will do it for you."
In file included from eth_lib.h:14,
                 from eth_lib.cc:10:
/usr/include/linux/socket.h:7:2: warning: #warning "You should include
<sys/socket.h>. This time I will do it for you."
/tmp/ccfRzJFM.o:(.bss+0x0): multiple definition of `ifr_orig'
/tmp/ccULI2yD.o:(.bss+0x0): first defined here
/tmp/ccfRzJFM.o:(.bss+0x20): multiple definition of `snoop_device'
/tmp/ccULI2yD.o:(.bss+0x20): first defined here
/tmp/ccfRzJFM.o:(.bss+0x40): multiple definition of `program_name'
/tmp/ccULI2yD.o:(.bss+0x40): first defined here
/tmp/ccfRzJFM.o: In function `p_error(char*)':
eth_lib.cc:(.text+0x38): warning: `sys_errlist' is deprecated; use
`strerror' or `strerror_r' instead
collect2: ld returned 1 exit status


The files of my program are available on netorld.free.fr/tp2.zip

Thanks for having read my message,

Alain



reply via email to

[Prev in Thread] Current Thread [Next in Thread]