Wenjing Jia wrote:
For instance, I followed the instructions in the Tutorial of the Boost.Program_options and compiled the first simplest possible example "example/first.cpp". I then went to "start" of Windows XP and Run "cmd", then run: "first --compression 10". The output is always "Compression level was set to -858993460." regardless of what value I type after the "--compression". Below is the full codes of the program (copied from the "example/first.cpp"):
...
I also tried on the other examples mentioned on that web page, such as "example/options_description.cpp". When I type: "options_description --optimization 4 -I foo a.cpp", the output is: "Include paths are: Input files are: Optimization level is -858993460". That is the input values are not taken and stored by the vm object.
Why such a simple example won't work on my machine!?
I imagine that the only reason for such behaviour could be some mismatch in compilation options between the library and the program. Does the problem persist if you try a later release? Do you have RTTI enabled in your project? Do you have any options affecting ABI set to values different from default (e.g. alignment) Also, are you sure you don't have *two* boost installations, of different version, and use headers from one installation and libraries from another? - Volodya