Quote Originally Posted by Paul McKenzie View Post
Why not? Who created inet.h? Whoever did create that file,
People for www.oversim.org

1) Change inet.h, or

2) just include inet.h (and use it) in only one module, or

3) If you must use it in another module, you have to enter the function declaration within the CPP file "by hand", and not do it using the include file:
Sorry it did not work. Here is the example code
Code:
//inet.h
#ifndef _INET_H
#define	_INET_H
class foo{
    void method1();
};

int method3(int x){
  return x+2;
}
#endif	/* _INET_H */

//exinet.h
#ifndef _EXINET_H
#define	_EXINET_H
#include "inet.h"

class foo2:public foo{
    
};

#endif	/* _EXINET_H */

//foo.cpp
#include "inet.h"

void foo::method1(){ 
}

//foo2.cpp
#include "exinet.h"
I get the followin error: inet.h:14: multiple definition of `method3(int)'

Even if I put the method declaration inside foo2.cpp !!without modifying!!! inet.h I get the same error. Is there any way to do it without modyfing inet.h