In article <2vr9q1F2nmgbvU1@uni-berlin.de>,
Gernot Frisch <Me@Privacy.net> wrote:[color=blue]
>
>"Alex Vinokur" <alexvn@big-foot.com> schrieb im Newsbeitrag
>news:2vr9anF2q4c1uU1@uni-berlin.de...[color=green]
>> 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
>>
>> -------------------[/color]
>
>3 ways:
>- inline in the header
>- write an .inc file and include it in the header (for the compiler
>that same as writing in the header)
>- get an compiler that can handle the export keyword - there's ony one
>from comeau and for portability I suggest not to use it.[/color]
If you mean portability across OSs, well Comeau supports the popular
ones and we are always willing and capable to bring it to others,
and in a reasonable timeframe and cost, and of course already do custom
ports with a goal of complete functionality and parts. If you mean
portability across compilers, then sure, this should be given
consideration.
BTW, I may be missing the point, but it seems to me that the
OPS question is strictly about cross translation unit inline'ing,
which hence makes suggesting export mostly a neutral issue.
--
Greg Comeau / Comeau C++ 4.3.3, for C++03 core language support
Comeau C/C++ ONLINE ==>
http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?