Parse error before static

Started by
2 comments, last by Prano 23 years, 5 months ago
Hello, I''m trying to compile NeHe tute with Dev-C++ and am encountering the "parse error before static" error. It seems to point to the line: static PIXELFORMATDESCRIPTOR pfd= // pfd Tells Windows How We Want Things To Be Any ideas? Thanks.
Advertisement
I have but only one solution at this point, use MSVC++ instead. I''v been attempting to use dev c++ for a quite a few different things, of which none have been successful. Basically, dev c++ kicks ass, but nobody seems to write code for it or really support it in any way. One problem i''ve had with it is missing ''defines'' and stuff in header files, or just missing the header files altogether. for example: CDS_FULLSCREEN is nowhere to be found in the header files because it''s just one of many things missing(for no apparent reason) from the mingw32 compiler package(which is the heart and soul of dev c++). So if you got the extra 100 bucks or so, go with msvc++. if not, i can''t find anything better than dev c++ for free goodies.

But anyway, i need to know what version and number tutorial you''re trying to compile. tut1 - mingw32/allegro version?

Try to give me any other details that could be a factor also, if you think of any. I should be able to respond within a day at most.
~Gumpus P. Maximus~
Instead of using:

static PIXELFORMATDESCRIPTOR pfd =

in the middle of the function, I cut and paste the whole passage and put it at the top of the function, without the static. It now compiles but fullscreen doesn''t seem to work. The program crashes if I select fullscreen. Windowed is fine.

As for the CDS_FULLSCREEN, this can be fixed with:

#ifndef CDS_FULLSCREEN
#define CDS_FULLSCREEN 4
#endif

at the start of the source. I still don''t know why the original source won''t work for the pixelformatdescriptor. Any ideas?

Also, I''ve heard that the standard ed. of msvc++ doesn''t fully optimise your code. Is this true?
It should work without problem see the mingw32 ports.
Yes, you are right about msvc++ standard ed. checkout Microsofts pages for details.

This topic is closed to new replies.

Advertisement