Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-06-12 12:02:19


omnizionic wrote:
> I downloaded and unzipped the latest boost (1.30.0) and tried using it
> in a simple file like this:
>
> #include <boost/smart_ptr.hpp>
> int main()
> {
> boost::shared_ptr<int> p(new int);
>
> return 0;
> }
>
> I compiled it, and got the following output:
> gcc -c -Wall -W -Werror -Wundef -Wfloat-equal -Wshadow -Wpointer-arith
> -Wcast-qual -Wwrite-strings -Wconversion -idirafter c:
> /programming/lib/kakefisk -Ic:/programming/boost_1_30_0 -O3
> -fomit-frame-pointer -ffast-math btest.cpp -o btest.o
> In file included from c:/programming/boost_1_30_0/boost/scoped_ptr.
> hpp:16,
> from c:/programming/boost_1_30_0/boost/smart_ptr.hpp:
> 17,
> from btest.cpp:1:
> c:/programming/boost_1_30_0/boost/checked_delete.hpp:4:5: "_MSC_VER"
> is not defined

The problem is caused by -Wundef generating a warning for the

#if _MSC_VER >= 1020

test, and by -Werror turning that warning into an error. I'll fix the CVS
version of smart_ptr to compile cleanly under -Wundef; in the meantime you
could either drop -Wundef or change the above lines to

#if defined(_MSC_VER) && (_MSC_VER >= 1020)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net