Build Errors on Windows

373 views
Skip to first unread message

hayfever

unread,
May 21, 2008, 8:10:19 AM5/21/08
to pbrt
I have the following build errors

c:\rl.p.folder\3D\source\pbrt-src-1.03\pbrt-1.03\core\
\pbrtlex.cpp(1907): error C3861: 'isatty': identifier not found, even
with argument-dependent lookup
C:\rl.p.folder\3D\source\pbrt-src-1.03\pbrt-1.03\core\util.cpp(401):
error C3861: 'snprintf': identifier not found, even with argument-
dependent lookup
C:\rl.p.folder\3D\source\pbrt-src-1.03\pbrt-1.03\core\exrio.cpp(16):
fatal error C1083: Cannot open include file: 'ImfInputFile.h': No such
file or directory

I am using vs2003 pbrt 1.03, I have cygwin installed with bison and
flex. Is there anything else I am missing

Thanks in advance

Kevin Egan

unread,
May 21, 2008, 10:40:33 AM5/21/08
to pb...@googlegroups.com
One of the problems is that it can't find the OpenEXR library
(ImfInputFile.h). The other problem is that it seems cygwin doesn't
have isatty() and snprintf() functions. You may have to modify the
source code to remove isatty() (this just determines if you are
connected to a console, you could assume true or false, it will just
change the frequency of writing to output), and you may have to change
snprintf() to sprintf() (which is slightly less safe).

Kevin

hayfever

unread,
May 21, 2008, 4:39:24 PM5/21/08
to pbrt
Thanks for the reply Kevein but this is getting so annoying,

I would expect this software to compile with minimum of fuss, the
reference
to the openexr include directory was wrong so i had to fix that. Am I
missing
something in order to get the core project to compile using snprintf
and vsnprintf.
I really don't want to be changing things before I even get the
software to work.


Thanks for your help

Kevin Egan

unread,
May 21, 2008, 4:54:15 PM5/21/08
to pb...@googlegroups.com
I don't believe Cygwin is one of the supported platforms so there are
going to be a few annoying things to fix. Either you are missing an
include file that has snprintf, but more likely Cygwin may not have
that function in it's C library.

The only difference in snprintf and sprintf is what happens when you
get a string that's too long. As long as you don't use filenames that
are 8000 characters long or other weird situations you should be fine.

Kevin

hayfever

unread,
May 21, 2008, 5:01:09 PM5/21/08
to pbrt
Sorry to be annoying, I don't follow the comment 'I don't believe
Cygwin is one of the supported platforms', I'm using windows (vs2003)
to compile pbrt not cygwin.


Cheers


Kevin Egan

unread,
May 21, 2008, 5:25:21 PM5/21/08
to pb...@googlegroups.com
Oh sorry, I got confused. So it seems like the snprintf() is a recent
fix trying to be more careful, but perhaps it wasn't tested on visual
studios (or at least VS2003)? The isatty() is slightly trickier
because that comes from code generated by the cygwin version of lex.

Anyway, I think for snprintf issue you should add to util.cpp:

#ifdef WIN32
#define snprintf _snprintf
#endif

For the isatty issue the easiest thing to do is to replace the trouble
line with:

b->yy_is_interactive = 0;

Both of these should be considered bugs. I don't know how to get at
the root of the second problem (since cygwin lex is generating the
problem code).

Kevin

Reply all
Reply to author
Forward
0 new messages