aboutsummaryrefslogtreecommitdiff
path: root/pipermail/nel/2001-March/000378.html
blob: 9bb5ad4f8c5d771a1ec406b3475edb7afc0dfc7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
   <TITLE> [Nel] ugh, C++ is so obtuse</TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:corvazier%40nevrax.com">
   <LINK REL="Previous"  HREF="000377.html">
   <LINK REL="Next" HREF="000381.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[Nel] ugh, C++ is so obtuse</H1>
    <B>Cyril Corvazier</B> 
    <A HREF="mailto:corvazier%40nevrax.com"
       TITLE="[Nel] ugh, C++ is so obtuse">corvazier@nevrax.com</A><BR>
    <I>Wed, 14 Mar 2001 16:57:42 +0100</I>
    <P><UL>
        <LI> Previous message: <A HREF="000377.html">[Nel] ugh, C++ is so obtuse</A></li>
        <LI> Next message: <A HREF="000381.html">[Nel] ugh, C++ is so obtuse</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#378">[ date ]</a>
              <a href="thread.html#378">[ thread ]</a>
              <a href="subject.html#378">[ subject ]</a>
              <a href="author.html#378">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>&gt;<i>
</I>c++ -I/usr/local/include/freetype2 -I/home/pierre/STLport-4.0/stlport -g -O2
&gt;<i>   -o client  character_interface.o client.o language_interface.o
</I>&gt;<i> login_interface.o move_listener.o pb_message_box.o player_view.o
</I>&gt;<i> shards_list_interface.o sight.o
</I>&gt;<i>
</I>lens_flare.o -lnelnet -lnelmisc -lnel3d -L/usr/local/lib -lfreetype -L/home/
&gt;<i> pierre/STLport-4.0/lib  -lstlport_gcc
</I>&gt;<i> /usr/local/lib/libnel3d.so: undefined reference to
</I>&gt;<i> `NL3D::CTrackKeyFramerLinear&lt;NL3D::CKeyQuat, NLMISC::CQuat&gt; type_info
</I>node'
&gt;<i> /usr/local/lib/libnel3d.so: undefined reference to
</I>&gt;<i> `NL3D::CTrackKeyFramerLinear&lt;NL3D::CKeyQuat,
</I>NLMISC::CQuat&gt;::getValue(void)
&gt;<i> const'
</I>
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&lt;class T&gt;
class a
{
    virtual void toto()=0;
};

template&lt;class T&gt;
class b : public a&lt;T&gt;
{
    virtual void toto()
    {
        ...
    };
};

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

In the .cpp:
-----------
virtual void b&lt;int&gt;::toto()
{
    ...
};

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

Any comments ?

---
Cyril Corvazier
Lead 3d programmer
Nevrax France



</pre>



<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI> Previous message: <A HREF="000377.html">[Nel] ugh, C++ is so obtuse</A></li>
	<LI> Next message: <A HREF="000381.html">[Nel] ugh, C++ is so obtuse</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#378">[ date ]</a>
              <a href="thread.html#378">[ thread ]</a>
              <a href="subject.html#378">[ subject ]</a>
              <a href="author.html#378">[ author ]</a>
         </LI>
       </UL>
</body></html>