Hello,

I have the following code structure:

Range.h:
------------
#ifndef __RANGE_H__
#define __RANGE_H__

#include <boost/icl/interval_map.hpp>
#include <boost/icl/gregorian.hpp>

using namespace boost::gregorian;
using namespace boost::icl;

class Range
{
public:
        Range() ;
        ~Range() ;

private:
       interval_map< date, int > m_mapRange
};

#endif // __CAMPAIGNS_BY_RANGE_H__

Range.cpp
----------------
#include "Range.h"

Range::Range() {

}

Range::~Range() {

}


main.cpp
--------------
#include "Range.h"
int main() {
    return 0;
}


When I build this code, I see the following errors:

main.o: In function `boost::icl::operator++(boost::gregorian::date&)':
main.cpp:(.text+0x0): multiple definition of `boost::icl::operator++(boost::gregorian::date&)'
Range.o:Range.cpp:(.text+0x0): first defined here
main.o: In function `boost::icl::operator--(boost::gregorian::date&)':
main.cpp:(.text+0x2d): multiple definition of `boost::icl::operator--(boost::gregorian::date&)'
Range.o:Range.cpp:(.text+0x2d): first defined here
main.o: In function `boost::icl::operator++(boost::gregorian::date_duration&)':
main.cpp:(.text+0x5a): multiple definition of `boost::icl::operator++(boost::gregorian::date_duration&)'
Range.o:Range.cpp:(.text+0x5a): first defined here
main.o: In function `boost::icl::operator--(boost::gregorian::date_duration&)':
main.cpp:(.text+0xa1): multiple definition of `boost::icl::operator--(boost::gregorian::date_duration&)'
Range.o:Range.cpp:(.text+0xa1): first defined here
collect2: ld returned 1 exit status
make: *** [rangetest] Error 1


Any ideas on how to resolve this would be greatly appreciated.

Thanks!



Twitter: @Blismobile
BlisMobile Media 
32 Percy Street,
London W1T 2DE
www.blismobile.com

BlisMobile
Follow on TwitterBlis Website

This communication is from BlisMobile Media, which is a trading name of Breeze Tech (UK) Ltd, a company registered in England and Wales with registered number 06455773. Its registered office is 32 Percy Street, London W1T 2DE, United Kingdom.

 

This communication contains information that is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s), please (1) notify info@blismobile.com by forwarding this email and delete all copies from your system and (2) note that disclosure, distribution, copying or use of this communication is strictly prohibited. Email communications cannot be guaranteed to be secure or free from error or viruses. All emails sent to or from a Blismobile email account are securely archived and stored by an external supplier. This email does not constitute a contractual agreement; such agreements are in specified contractual or Insertion Order (IO) form only and exclusively contain all the terms to which Breeze Tech )UK) Ltd will be bound. To the extent permitted by law, Breeze Tech (UK) Ltd does not accept any liability for use of or reliance on the contents of this email by any person save by the intended recipient(s) to the extent agreed in a contract or Insertion Order.

 

Opinions, conclusions and other information in this email which have not been delivered by way of the business of Breeze Tech (UK) Ltd are neither given nor endorsed by it.