nel-all
[Top][All Lists]
Advanced

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

Re: [Nel] ugh, C++ is so obtuse


From: Cyril Corvazier
Subject: Re: [Nel] ugh, C++ is so obtuse
Date: Wed, 14 Mar 2001 16:57:42 +0100

>
c++ -I/usr/local/include/freetype2 -I/home/pierre/STLport-4.0/stlport -g -O2
>   -o client  character_interface.o client.o language_interface.o
> login_interface.o move_listener.o pb_message_box.o player_view.o
> shards_list_interface.o sight.o
>
lens_flare.o -lnelnet -lnelmisc -lnel3d -L/usr/local/lib -lfreetype -L/home/
> pierre/STLport-4.0/lib  -lstlport_gcc
> /usr/local/lib/libnel3d.so: undefined reference to
> `NL3D::CTrackKeyFramerLinear<NL3D::CKeyQuat, NLMISC::CQuat> type_info
node'
> /usr/local/lib/libnel3d.so: undefined reference to
> `NL3D::CTrackKeyFramerLinear<NL3D::CKeyQuat,
NLMISC::CQuat>::getValue(void)
> const'

I have fixed that bug. It should be on the cvs tonight (GMT+1).

*** For c++ addicts, here is the problem ***

The link failed under GCC when we use non-inline functions in a template
implementation.
No problem with Visual C++ 6.0.

It looked like this:

in the .h file:
-----------

// Two template classes
template<class T>
class a
{
    virtual void toto()=0;
};

template<class T>
class b : public a<T>
{
    virtual void toto()
    {
        ...
    };
};

// The second one is implemented, but toto function body is in the .cpp
file.
class b<int> : public a<int>
{
    virtual void toto();
};

In the .cpp:
-----------
virtual void b<int>::toto()
{
    ...
};

The fixe was to let the toto body inline in the header.

Any comments ?

---
Cyril Corvazier
Lead 3d programmer
Nevrax France




reply via email to

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