aspell-user
[Top][All Lists]
Advanced

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

Re: [Aspell-user] aspell-0.60 Compile Problem: undefined reference


From: Gary Setter
Subject: Re: [Aspell-user] aspell-0.60 Compile Problem: undefined reference
Date: Thu, 10 Nov 2005 09:59:08 -0600

----- Original Message ----- 
<snip>
> ./.libs/libaspell.so: undefined reference to
> `acommon::HashTable<acommon::StringMap::Parms>::init(unsigned
int)'
> ./.libs/libaspell.so: undefined reference to
> `acommon::HashTable<acommon::StringMap::Parms>::del()'
> ./.libs/libaspell.so: undefined reference to
> `acommon::BlockSList<acommon::StringPair>::clear()'
> collect2: ld returned 1 exit status
>
> My C++ is a little rusty. Where are those methods defined? Why
can't the
> linker find them in the above case?
Hi Richard,
Short answer - They are defined in  hash-t.hpp and
block_slist-t.hpp.

Longer answer
The HashTable and BlockSList classes are template classes. The
actual code is generated by the compiler as needed. They are
declared in hash.hpp and block_slist.hpp. However, some of their
methods are defined in hash-t.hpp and block_slist-t.hpp.

Why the separation? Why not define all the methods in one file? I
believe the idea is that in many cases the definitions are not
needed. When they are not, a module need only include hash.hpp.
When they are, we include hash-t.hpp.

The compiler I use had the same problems as you are experiencing.
My response was to move from including hash.hpp to including
hash-t.hpp. Yes, that gives the compiler more to do and negates
the separation between declaration and definition, but I was able
to get a successful build.





reply via email to

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