Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2004-07-14 05:57:39


Vladimir,

I have some fixes for the program_options library on Win32 for you, first
off here's the problem:

On Win32 you must use the a dynamic runtime if you are building or using a
dll: if you don't do this then separate runtimes/memory managers etc get
linked to each module and the result is almost always a runtime crash some
point. However you are also using std::locale and so have added
std::facet-support std::locale-support to your build requirements. Doing so
however, causes the static runtime to be used, so you're in a bit of a
catch-22 situation here I'm afraid. You've also failed to define
BOOST_ALL_DYN_LINK when *using* your dll - this is causing the mscv link
failures.
The patches below address both of these issues, tested with:

VC7.1: everything passes.

VC7.0: everything passes except the tests that use \u (unsupported).

Intel 8 on vc7.1: everything passes.

Intel 7.1 on vc7.1 everything pases except the tests that use \u
(unsupported).

Borland 5.6.4: all tests pass.

Borland 5.5.1: Internal compiler error in function from_8bit, haven't
investigated further yet.

The fact that these tests do pass with Intel, possibly means that
std::facet-support could be deprecated - it looks like Intel have fixed that
problem with their recent patches. However, you may still experience
problems with Metrowerks - I think there is any way around this - the dll
version of the library is going to be unusable with that compiler.

One final thing: you declare the environ variable in your sources, which is
leading to warnings from MSVC and Intel about conflicting dll-specifications
for that variable, perhaps you should include the header required rather
than defining the variable yourself (unistd.h when BOOST_HAS_UNISTD_H is
defined, or stdlib.h on WIN32)?

John

Index: build/Jamfile
===================================================================
RCS file: /cvsroot/boost/boost/libs/program_options/build/Jamfile,v
retrieving revision 1.2
diff -u -r1.2 Jamfile
--- build/Jamfile 18 May 2004 06:38:17 -0000 1.2
+++ build/Jamfile 14 Jul 2004 10:32:56 -0000
@@ -21,7 +21,7 @@
        <define>BOOST_ALL_DYN_LINK=1 # tell source we're building dll's
        <runtime-link>dynamic # build only for dynamic runtimes
        <include>$(BOOST_ROOT) <sysinclude>$(BOOST_ROOT)
- std::facet-support std::locale-support
+ #std::facet-support std::locale-support
      : debug release # build variants
      ;

cvs diff: Diffing doc
cvs diff: Diffing example
cvs diff: Diffing src
cvs diff: Diffing test
Index: test/Jamfile
===================================================================
RCS file: /cvsroot/boost/boost/libs/program_options/test/Jamfile,v
retrieving revision 1.4
diff -u -r1.4 Jamfile
--- test/Jamfile 28 Jun 2004 09:31:28 -0000 1.4
+++ test/Jamfile 14 Jul 2004 10:32:56 -0000
@@ -19,7 +19,9 @@
        run $(name).cpp <dll>../build/boost_program_options
        <lib>../../test/build/boost_test_exec_monitor : :
     : <include>$(BOOST_ROOT)
- std::facet-support std::locale-support
+ #std::facet-support std::locale-support
+ <define>BOOST_ALL_DYN_LINK=1
+ <runtime-link>dynamic
     : $(name)_dll ]
     ;
 }


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk