POV-Ray : Newsgroups : povray.beta-test : Compile errors with VS 2005 on Windows XP Server Time
29 Jul 2024 18:36:20 EDT (-0400)
  Compile errors with VS 2005 on Windows XP (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Christian Froeschlin
Subject: Re: Compile errors with VS 2005 on Windows XP
Date: 29 Mar 2009 14:38:32
Message: <49cfc028@news.povray.org>
Chris Cason wrote:

> madiyaan damha wrote:
>> I downloaded povray source code for windows and am trying to build it on windows
>> xp using visual studio 2005. I installed boost 1.37 using boostpro's installer.
>>
>> I am getting the following errors while building the unmodified source code:
> 
> Please let me know if you resolve this.

Has there been any news on this? Just downloaded sources for beta 31
and encountered the same problem (that is using express and separate
platform SDK, but as the OP has the full version that should not be
the issue here). The last version I compiled myself was beta24 with
boost 1.34 which worked fine. Also, if I modify the beta24 project
to use boost 1.37 I get the same errors so I'm fairly certain the
changed behavior is related to the boost header files.

Regarding bad timing with including windows.h, I suspect
the following chain causes the problem:

   boost/thread.hpp
   boost/thread/thread.hpp
   boost/thread/win32/thread_data.hpp
   boost/thread/thread_time.hpp
   boost/date_time/microsec_time_clock.hpp
   C:\Program Files\Microsoft Platform SDK\Include\windows.h

The file thread_time.hpp is new in 1.37.

Frankly, I don't understand at all how this boost configuration
works. In microsec_time_clock.hpp the code specified is actually

   #ifdef BOOST_HAS_FTIME
   #include <windows.h>
   #endif

but I don't find any place where BOOST_HAS_FTIME is #define'd.
If I try to hack an #undef into the code it has either no effect
or causes error C2039: 'microsec_clock' : is not a member of
'boost::date_time' depending on where I insert it.

Note: The different behavior may be caused by using the BoostPro
installer package for win32 http://www.boostpro.com/products/free which
is the recommended way to get boost according to the getting started
http://www.boost.org/doc/libs/1_35_0/more/getting_started/windows.html
in the boost documentation. I just noticed the Beta31 readme does not
mention this and recommends your own package or to build from source.

Finally, isn't the actual problem that there are name collisions
between the POV Code and Platform Includes? Wouldn't the solution
be to replace, e.g., IStream with pov_base::IStream instead of
depending on the include location of windows.h?


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Compile errors with VS 2005 on Windows XP
Date: 29 Mar 2009 15:05:40
Message: <49cfc684$1@news.povray.org>
Christian Froeschlin wrote:

> I just noticed the Beta31 readme does not mention 
> this and recommends your own package or to build from source.

ah well now I got your package and guess what there are
patched boost headers in there. Is this your change Chris?

microsec_time_clock.hpp:

#ifdef BOOST_HAS_FTIME
#	if defined( BOOST_USE_WINDOWS_H )
#		include <windows.h>
#	else
struct _FILETIME;
struct _SYSTEMTIME;
...
#	endif // !BOOST_USE_WINDOWS_H

The readme file for the beta31 sources explicitely mentions
that you can get the header files from boost.org, so custom
fixes in the boost headers are a bit of a problem.

Anyway seems like it starts compiling ok now!


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Compile errors with VS 2005 on Windows XP
Date: 29 Mar 2009 18:28:17
Message: <49cff601$1@news.povray.org>
Christian Froeschlin wrote:

> Anyway seems like it starts compiling ok now!

Ok everything was built fine so I confirm that using boost
from http://www.povray.org/beta/source/boost_3.7_win32.zip
instead of the official 1.37 solves the problem.

Also, I'm happy to confirm that apart from the above problem
beta 31 compiles with Visual C++ Express 2005 without any need
for changes to the project files. I just set BOOST_ROOT, and
I already had the Platform SDK.

BTW, iline 328 in pvtext.cpp caused a debug assertion during startup

only accepts values between -1 an 0xFF, but char is signed). The
character is not printed. A cast to (unsigned char) prevents the
debug assertion. Removing the isprint test actually caused
the character to be printed correctly.


Post a reply to this message

From: Chris Cason
Subject: Re: Compile errors with VS 2005 on Windows XP
Date: 6 Apr 2009 01:46:53
Message: <49d9974d@news.povray.org>
Christian Froeschlin wrote:
>> Anyway seems like it starts compiling ok now!
> 
> Ok everything was built fine so I confirm that using boost
> from http://www.povray.org/beta/source/boost_3.7_win32.zip
> instead of the official 1.37 solves the problem.
> 
> Also, I'm happy to confirm that apart from the above problem
> beta 31 compiles with Visual C++ Express 2005 without any need
> for changes to the project files. I just set BOOST_ROOT, and
> I already had the Platform SDK.
> 
> BTW, iline 328 in pvtext.cpp caused a debug assertion during startup

> only accepts values between -1 an 0xFF, but char is signed). The
> character is not printed. A cast to (unsigned char) prevents the
> debug assertion. Removing the isprint test actually caused
> the character to be printed correctly.

Thanks for the info, I'll try to get that fix into the beta 32 source before I
release it.

-- Chris


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Compile errors with VS 2005 on Windows XP
Date: 17 May 2009 22:54:02
Message: <4a10cdca@news.povray.org>
Christian Froeschlin wrote:
> Finally, isn't the actual problem that there are name collisions
> between the POV Code and Platform Includes? Wouldn't the solution
> be to replace, e.g., IStream with pov_base::IStream instead of
> depending on the include location of windows.h?

POV-Ray stuff is already in a namespace. The big problem with windows.h is
that it defines *macros*. If you have a my_namespace::MyClass::OpenFile
method, and you included windows.h, you'll get annoying error messages
about OpenFileA [sic!] not being defined.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.