So who''s entering?
(i m btw)
Mini Challenge
I might work an an entry sunday
, if i complete some sort of an entry i''ll post it
. Unfortunately i haven''t got time till then
.



I thought I would compile it and see what it was like, then decide if I wanted to make an entry. I can''t get it to compile in MSVC .NET, gives 13 build errors. I got the glut lib and header from http://www.xmission.com/~nate/glut.html and I belive I put those files in the correct places. I''m not really savvy enough to find the reason for the problems very quickly. If you want I will post the errors.
Compiling...Null.cppc:\Documents and Settings\HaVoK\Desktop\mini challenge\minicontest\Null.h(23) : error C2039: '' *'' : is not a member of ''Null'' c:\Documents and Settings\HaVoK\Desktop\mini challenge\minicontest\Null.h(7) : see declaration of ''Null''c:\Documents and Settings\HaVoK\Desktop\mini challenge\minicontest\Null.h(26) : error C2270: ''$S1'' : modifiers not allowed on nonmember functionsMap.cppc:\Documents and Settings\HaVoK\Desktop\mini challenge\minicontest\Null.h(23) : error C2039: '' *'' : is not a member of ''Null'' c:\Documents and Settings\HaVoK\Desktop\mini challenge\minicontest\Null.h(7) : see declaration of ''Null''c:\Documents and Settings\HaVoK\Desktop\mini challenge\minicontest\Null.h(26) : error C2270: ''$S1'' : modifiers not allowed on nonmember functionsMap.cpp(61) : warning C4244: ''argument'' : conversion from ''int'' to ''float'', possible loss of dataMap.cpp(61) : warning C4244: ''argument'' : conversion from ''int'' to ''float'', possible loss of dataMap.cpp(75) : error C2679: binary ''='' : no operator found which takes a right-hand operand of type ''const Null'' (or there is no acceptable conversion)Map.cpp(100) : error C2679: binary ''='' : no operator found which takes a right-hand operand of type ''const Null'' (or there is no acceptable conversion)Map.cpp(192) : error C2440: ''return'' : cannot convert from ''const Null'' to ''Brick *'' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be calledMain.cppc:\Documents and Settings\HaVoK\Desktop\mini challenge\minicontest\Null.h(23) : error C2039: '' *'' : is not a member of ''Null'' c:\Documents and Settings\HaVoK\Desktop\mini challenge\minicontest\Null.h(7) : see declaration of ''Null''c:\Documents and Settings\HaVoK\Desktop\mini challenge\minicontest\Null.h(26) : error C2270: ''$S1'' : modifiers not allowed on nonmember functionsMain.cpp(76) : error C2664: ''time'' : cannot convert parameter 1 from ''const Null'' to ''time_t *'' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be calledBall.cppC:\Program Files\Microsoft Visual Studio .NET\Vc7\include\stdlib.h(251) : error C2381: ''exit'' : redefinition; __declspec(noreturn) differs C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\gl\glut.h(146) : see declaration of ''exit''
Hmm, the last error can be solved by changing line 15 of glut.h from:
to
This means glut gets it''s definition of exit from windows.h, instead of redefining it''s own exit function.
The rest of the errors seem to be stemming from the templated casting member function in class Null. This is taken straight from Scott Meyer''s book ''Effective C++'', so I can''t imagine that the code is invalid. I''ll try compiling it under Visual C++ later today and see if I can get it to compile.
It''s interesting that Visual C++ spits out a couple of warnings - both Borland C++Builder and gcc compile it with out warnings, and I thought they were stricter than Visual C++!
Enigma
# if 0
to
# if 1
This means glut gets it''s definition of exit from windows.h, instead of redefining it''s own exit function.
The rest of the errors seem to be stemming from the templated casting member function in class Null. This is taken straight from Scott Meyer''s book ''Effective C++'', so I can''t imagine that the code is invalid. I''ll try compiling it under Visual C++ later today and see if I can get it to compile.
It''s interesting that Visual C++ spits out a couple of warnings - both Borland C++Builder and gcc compile it with out warnings, and I thought they were stricter than Visual C++!
Enigma
Can you post a vc++ 6.0 workspace with your files...makes things a bit easier (vc++ 6.0 seems 2 b standard on this site).
ssnhavok: I tried compiling the code under VC++ .NET and I didn't get the errors you posted (I got a few other errors, but they were easily fixed). Try making the Null casting function inline, i.e. change:
to
in the class declaration and remove:
from after the class declaration.
everyone: I've uploaded a version that compiles under VC++ .NET (including the project file). I don't have access to VC++ 6, so if the .NET project file doesn't work in VC++ 6 then I'm afraid you're on your own
.
Realised I hadn't said what the controls are. Assuming people are able to compile the code, and that they haven't figured the controls out already:
The mouse moves the bat.
Space begins play.
Enter skips to the next level (since only the fifth level has all brick types in it).
Enigma
EDIT: angle brackets
[edited by - Enigma on February 13, 2004 10:20:39 AM]
template <typename TYPE>operator TYPE*() const;
to
template <typename TYPE>operator TYPE*() const{ return 0;}
in the class declaration and remove:
template <typename TYPE>Null::operator TYPE*() const{ return 0;}
from after the class declaration.
everyone: I've uploaded a version that compiles under VC++ .NET (including the project file). I don't have access to VC++ 6, so if the .NET project file doesn't work in VC++ 6 then I'm afraid you're on your own

Realised I hadn't said what the controls are. Assuming people are able to compile the code, and that they haven't figured the controls out already:
The mouse moves the bat.
Space begins play.
Enter skips to the next level (since only the fifth level has all brick types in it).
Enigma
EDIT: angle brackets
[edited by - Enigma on February 13, 2004 10:20:39 AM]
I took 5 minutes while working to go through the code on vc++ 6.0. Got it down to 10 errors...not enough time to finish the rest. Here they are:
c:\windows\desktop\asdf\mini challenge\null.h(23) : error C2039: '' *'' : is not a member of ''Null''
c:\windows\desktop\asdf\mini challenge\null.h(7) : see declaration of ''Null''
c:\windows\desktop\asdf\mini challenge\null.h(26) : error C2270: ''$S23'' : modifiers not allowed on nonmember functions
c:\windows\desktop\asdf\mini challenge\main.cpp(76) : error C2664: ''time'' : cannot convert parameter 1 from ''const class Null'' to ''long *''
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Map.cpp
c:\windows\desktop\asdf\mini challenge\null.h(23) : error C2039: '' *'' : is not a member of ''Null''
c:\windows\desktop\asdf\mini challenge\null.h(7) : see declaration of ''Null''
c:\windows\desktop\asdf\mini challenge\null.h(26) : error C2270: ''$S14'' : modifiers not allowed on nonmember functions
c:\windows\desktop\asdf\mini challenge\map.cpp(75) : error C2679: binary ''='' : no operator defined which takes a right-hand operand of type ''const class Null'' (or there is no acceptable conversion)
c:\windows\desktop\asdf\mini challenge\map.cpp(100) : error C2679: binary ''='' : no operator defined which takes a right-hand operand of type ''const class Null'' (or there is no acceptable conversion)
c:\windows\desktop\asdf\mini challenge\map.cpp(192) : error C2440: ''return'' : cannot convert from ''const class Null'' to ''class Brick *''
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Null.cpp
c:\windows\desktop\asdf\mini challenge\null.h(23) : error C2039: '' *'' : is not a member of ''Null''
c:\windows\desktop\asdf\mini challenge\null.h(7) : see declaration of ''Null''
c:\windows\desktop\asdf\mini challenge\null.h(26) : error C2270: ''$S1'' : modifiers not allowed on nonmember functions
wondering if u know a quick fix. I''ll post the vc++ 6.0 source if u want.
c:\windows\desktop\asdf\mini challenge\null.h(23) : error C2039: '' *'' : is not a member of ''Null''
c:\windows\desktop\asdf\mini challenge\null.h(7) : see declaration of ''Null''
c:\windows\desktop\asdf\mini challenge\null.h(26) : error C2270: ''$S23'' : modifiers not allowed on nonmember functions
c:\windows\desktop\asdf\mini challenge\main.cpp(76) : error C2664: ''time'' : cannot convert parameter 1 from ''const class Null'' to ''long *''
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Map.cpp
c:\windows\desktop\asdf\mini challenge\null.h(23) : error C2039: '' *'' : is not a member of ''Null''
c:\windows\desktop\asdf\mini challenge\null.h(7) : see declaration of ''Null''
c:\windows\desktop\asdf\mini challenge\null.h(26) : error C2270: ''$S14'' : modifiers not allowed on nonmember functions
c:\windows\desktop\asdf\mini challenge\map.cpp(75) : error C2679: binary ''='' : no operator defined which takes a right-hand operand of type ''const class Null'' (or there is no acceptable conversion)
c:\windows\desktop\asdf\mini challenge\map.cpp(100) : error C2679: binary ''='' : no operator defined which takes a right-hand operand of type ''const class Null'' (or there is no acceptable conversion)
c:\windows\desktop\asdf\mini challenge\map.cpp(192) : error C2440: ''return'' : cannot convert from ''const class Null'' to ''class Brick *''
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Null.cpp
c:\windows\desktop\asdf\mini challenge\null.h(23) : error C2039: '' *'' : is not a member of ''Null''
c:\windows\desktop\asdf\mini challenge\null.h(7) : see declaration of ''Null''
c:\windows\desktop\asdf\mini challenge\null.h(26) : error C2270: ''$S1'' : modifiers not allowed on nonmember functions
wondering if u know a quick fix. I''ll post the vc++ 6.0 source if u want.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement