Home » Community » Forums » For Beginners » Error in the glut.h
  Intel sponsors gamedev.net search:   
[Control Panel] [Register] [Bookmarks] [Who's Online] [Active Topics] [Stats] [FAQ] [Search]

Add Forum to Favorites |  Send Topic To a Friend | View Forum FAQ | Track this topic


 Last Thread Next Thread 
 Error in the glut.h
Post New Topic  Post Reply 
I've this problem. Whenever I include the glut.h library, I get error in this line (of the glut.h):

extern _CRTIMP void __cdecl exit(int); //line 146

I've downloaded many times the library, and I've installed the .dll and .lib correctly. But always have the same error.

For example, using the tutorials of Nehe's page about Glut.

So, what I'm doing wrong?

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

whats the error message?

 User Rating: 1136   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Uhh sorry, I forgot

This is the message:

[C++ Error] glut.h(146): E2337 Only one of a set of overloaded functions can be "C"

I'm new with C++ so I don't get it all.

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Are you including the file twice?

Do you have a function named exit in your program?

Have you included or ?



 User Rating: 1136   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

glut.h is correct.

You're using Visual C++ 7.0, which changed the prototypes for exit and abort (addedd a __declspec(noreturn) - a Microsoft extension, not standard C++.

Go read the 'correct' declaration in and mirror it into glut.h with an #ifdef testing that you have the 'right' version of Visual C++.

Edit: Ah, well, here's the code to be substituted in glut.h
#if defined(_WIN32)
# ifndef GLUT_BUILDING_LIB
#  if _MSC_VER >= 1200
	_CRTIMP __declspec(noreturn) void   __cdecl abort(void);
	_CRTIMP __declspec(noreturn) void   __cdecl exit(int);
#  else
	_CRTIMP void   __cdecl abort(void);
	_CRTIMP void   __cdecl exit(int);
#  endif
# endif
#else
/* non-Win32 case. */
 




[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]


[edited by - Fruny on December 17, 2002 8:09:51 AM]

 User Rating: 2027   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may not post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: