|
Boost : |
From: Olaf van der Spek (OvdSpek_at_[hidden])
Date: 2004-12-15 18:47:46
Hi,
I was trying to use the program_options library and used the following
example.
However, I got an internal compiler error.
I reduced the example to this minimum.
The library build fine, so I assume it's compatible with VC6.
What went wrong?
Code:
#include "stdafx.h"
#include <boost/program_options.hpp>
#include <iostream>
int main(int ac, char* av[])
{
boost::program_options::variables_map vm;
std::cout << vm["compression"].as<int>(); // line 8
return 0;
}
Output:
Configuration: Program Options Test - Win32 Release
Compiling...
StdAfx.cpp
Compiling...
Program Options Test.cpp
C:\VC\temp\Program Options Test\Program Options Test.cpp(8) : error
C2679: binary '<<' : no operator defined which takes a right-hand
operand of type '' (or there is no acceptable conversion)
C:\VC\temp\Program Options Test\Program Options Test.cpp(8) : error
C2062: type 'int' unexpected
Error executing cl.exe.
Program Options Test.exe - 2 error(s), 0 warning(s)
Configuration: Program Options Test - Win32 Debug
Compiling...
Program Options Test.cpp
C:\VC\temp\Program Options Test\Program Options Test.cpp(8) : fatal
error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1794)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more
information
Error executing cl.exe.
Program Options Test.exe - 1 error(s), 0 warning(s)
-- Olaf van der Spek http://xccu.sf.net/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk