[newbie] Boost 1.39 in Mac XCode get "error: attempt to copy-construct an iterator from a singular iterator."
Hi,
I'm new to boost. It seems that the coding of boost library is not very
clean as it makes the debug code aborted by generating a runtime error like
this: "error: attempt to copy-construct an iterator from a singular
iterator.".
Here are the steps to reproduce the fault:
I downloaded the source and install the things to /usr/local/include as well
as /usr/local/lib.
I test the code by creating a "C++ Tool" project in XCode.
1. Create a new C++ Tool project.
2. Add the header search path /usr/local/include/boost-1_39 and library
search path /usr/local/lib into the project.
3. Add "Other Linker Flags" "-lboost_system-xgcc40-mt" in the project
setting.
4. Edit the main.cpp as below:
#include <iostream>
#include
On 28 Jul 2009, at 09:10, Victor Tsang wrote:
Hi, ...
The Debugger Debugger is attaching to process
It generates a runtime error "error: attempt to copy-construct an iterator from a singular iterator.".
However, if I compile the code in terminal: g++ -o test -g -Wall main.cpp -lboost_system-xgcc40-mt
It runs okay without any runtime error.
To duplicate the error from the command line, add ' -D_GLIBCXX_DEBUG '
to the command line, which turns on g++'s iterator debugging. Doing
this, I can duplicate your problem.
The problem can be boiled down to the following, illegal, code.
#include <vector>
#include <list>
int main(void)
{
std::vector
participants (2)
-
Christopher Jefferson
-
Victor Tsang