Errors compiling a Unix OpenGL app in Windows XP with VS.Net 2003

oLLie

Diamond Member
Jan 15, 2001
5,203
1
0
These are the errors I get:
fatal error C1083: Cannot open include file: 'stream.h': No such file or directory
fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
fatal error C1083: Cannot open include file: 'vector.h': No such file or directory
fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory
fatal error C1083: Cannot open include file: 'stream.h': No such file or directory
fatal error C1083: Cannot open include file: 'stream.h': No such file or directory
error C2144: syntax error : 'void' should be preceded by ';'
error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
error C2146: syntax error : missing ';' before identifier 'glAccum'
error C2182: 'APIENTRY' : illegal use of type 'void'

The fatal errors look like either deprecated headers or GNU-specific headers, not sure what to do about the latter case. I think I fixed the iostream.h error before by changing the #include <iostream.h> to #include <iostream> followed by using namespace std;

The last 4 errors are basically repeated a hundred times or so until the compiler gave up and said you have too many errors, and stopped compiling. Everything I come up with via Google says that I should #include <windows.h> (some sites says #include <wtypes.h> and #include <windef.h> ) just prior to the #include <GL/gl.h> and it seemed to work for all those people who had the problem, but it doesn't work for me. I set the project up as a Win32 Empty Project.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Did you check the file format? Unix uses a different character for line-feeds than Windows, the MS compiler might not be dealing well with that.
 

Templeton

Senior member
Oct 9, 1999
467
0
0
I'm pretty sure stream.h is deprecated and non standard, you won't find it on windows. unistd.h is posix specific, no drop in windows version for what it does. include vector in the same way as iostream, without the .h, this is the proper c++ way. Next, remove the includes for unistd and stream, compile and see what depended on them. Should be able to find some type of windows api calls/iostream equivalent for what they were doing.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: Templeton
I'm pretty sure stream.h is deprecated and non standard, you won't find it on windows. unistd.h is posix specific, no drop in windows version for what it does. include vector in the same way as iostream, without the .h, this is the proper c++ way. Next, remove the includes for unistd and stream, compile and see what depended on them. Should be able to find some type of windows api calls/iostream equivalent for what they were doing.

I did this recently and it's a PITA. But fun. :D