A
Alex Vinokur
Is it possible to call in source2.cpp a method inlined in source1.cpp?
--- File foo.h ---
#ifndef FOO_H
#define FOO_H
struct Foo { void foo (); };
#endif
------------------
--- File foo1.cpp ---
#include "foo.h"
inline void Foo::foo() {}
---------------------
--- File foo2.cpp ---
#include "foo.h"
int main ()
{
Foo f;
f.foo();
return 0;
}
---------------------
--- Compilation ---
$ gpp --version
gpp.exe (GCC) 3.4.1
[---omitted---]
$ gpp foo1.cpp foo2.cpp
c:/djgpp/tmp/cckdogiI.o(.text+0x24):foo2.cpp: undefined reference to `Foo::foo()'
collect2: ld returned 1 exit status
--- File foo.h ---
#ifndef FOO_H
#define FOO_H
struct Foo { void foo (); };
#endif
------------------
--- File foo1.cpp ---
#include "foo.h"
inline void Foo::foo() {}
---------------------
--- File foo2.cpp ---
#include "foo.h"
int main ()
{
Foo f;
f.foo();
return 0;
}
---------------------
--- Compilation ---
$ gpp --version
gpp.exe (GCC) 3.4.1
[---omitted---]
$ gpp foo1.cpp foo2.cpp
c:/djgpp/tmp/cckdogiI.o(.text+0x24):foo2.cpp: undefined reference to `Foo::foo()'
collect2: ld returned 1 exit status