multiple definition
<p>My code had an error about not defining the <code>operator&lt;</code>. I corrected the <code>operator&lt;</code> problem in my code by overloading it. When I compile it, there was no error there but it has lots of errors about multidefinition. My code is:</p>

<pre><code>int Vector3D::operator &lt; (const Vector 3D &amp;vector) const
{
 if(x&lt;vector.x)
   return 1;
 else
   return 0;
}
</code></pre>

<p>Here are some of the lines:</p>

<pre><code>debug/src/common/propagation-delay-model_1.o: In function `empty':
/usr/include/c++/4.1.2/limits:1044: multiple definition of `ns3::Vector3D::operator&lt;(ns3::Vector3D const&amp;) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/common/propagation-loss-model_1.o: In function `empty':
/usr/include/c++/4.1.2/new:94: multiple definition of `ns3::Vector3D::operator&lt;(ns3::Vector3D const&amp;) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/common/jakes-propagation-loss-model_1.o: In function `empty':
/usr/include/c++/4.1.2/new:94: multiple definition of `ns3::Vector3D::operator&lt;(ns3::Vector3D const&amp;) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/common/cost231-propagation-loss-model_1.o: In function `empty':
/usr/include/c++/4.1.2/limits:1044: multiple definition of `ns3::Vector3D::operator&lt;(ns3::Vector3D const&amp;) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/common/spectrum-propagation-loss-model_1.o: In function `~BandInfo':
/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/debug/ns3/type-id.h:392: multiple definition of `ns3::Vector3D::operator&lt;(ns3::Vector3D const&amp;) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/common/friis-spectrum-propagation-loss_1.o: In function `~BandInfo':
/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/debug/ns3/vector.h:118: multiple definition of `ns3::Vector3D::operator&lt;(ns3::Vector3D const&amp;) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/node/spectrum-phy_1.o: In function `~TypeId':
/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/debug/ns3/type-id.h:392: multiple definition of `ns3::Vector3D::operator&lt;(ns3::Vector3D const&amp;) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/internet-stack/ipv6-l3-protocol_1.o: In function `new_allocator':
/usr/include/c++/4.1.2/new:94: multiple definition of `ns3::Vector3D::operator&lt;(ns3::Vector3D const&amp;) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/routing/olsr/olsr-routing-protocol_1.o: In function `~Association':
/usr/include/c++/4.1.2/new:94: multiple definition of `ns3::Vector3D::operator&lt;(ns3::Vector3D const&amp;) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/routing/olsr/test/bug780-test_1.o: In function `new_allocator':
/usr/include/c++/4.1.2/new:94: multiple definition of `ns3::Vector3D::operator&lt;(ns3::Vector3D const&amp;) const' 
</code></pre>
