PDA

View Full Version : GLUT + Bc55



11-22-2001, 10:37 AM
If I
#include <GL/glut.h>

#include <stdio.h>
#include <stdlib.h>

and compile I get next error...
c:\Borland\Bcc55\include\stdlib.h 584: Only one of a set of
overloaded functions can be "C"


If I only do it with
#include <GL/glut.h>
it works fine...

why is it?

11-22-2001, 03:40 PM
It is because the Borland headers are little different. C code works, C++ gives your error. I think that including windows.h before glut.h fix it. A perhaps better solution is to change "if 0" to "if 1" in glut.h or make this for C++ only.

LeQoq
11-23-2001, 03:44 AM
i think in your bc-project you must apply:
"console", and switch to "c-node" under "advanced".
everything else you must turn off, or you use some kind of code templates, but you don't need this.
and on a windows-system you need to include "windows.h" before "glut.h".

ida
05-01-2002, 08:48 AM
Originally posted by borlander:
If I
#include <GL/glut.h>

#include <stdio.h>
#include <stdlib.h>

and compile I get next error...
c:\Borland\Bcc55\include\stdlib.h 584: Only one of a set of
overloaded functions can be "C"


If I only do it with
#include <GL/glut.h>
it works fine...

why is it?


Hello, how did you resolve the problem, becouse I ahve the same one.

from Ida

Deiussum
05-01-2002, 09:44 AM
Ok... I just tried doing just that with the free command-line compiler from Borland. (5.5) I had no errors... curious about what is on that line, I opened up stdlib.h and went to line 584. I found this...

using std::exit;
It's inside a big block within

#if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__STDLIB_H_USING_LIST)


#endif

What does your stdlib.h have at that line? From the error it sounds like it has to have something like

extern "C" someFunction();

ida
05-02-2002, 08:31 AM
Originally posted by Deiussum:
Ok... I just tried doing just that with the free command-line compiler from Borland. (5.5) I had no errors... curious about what is on that line, I opened up stdlib.h and went to line 584. I found this...

using std::exit;
It's inside a big block within

#if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__STDLIB_H_USING_LIST)


#endif

What does your stdlib.h have at that line? From the error it sounds like it has to have something like

extern "C" someFunction();

Thanks a lot, I do not know if it is correct to put as a comment 'using std::exit;', in stdlib but it works to accept some functions I was using.

from IDa

Deiussum
05-02-2002, 11:29 AM
Do you have your own exit function somewhere? Perhaps that is the reason commenting out that line causes it to work for you. I hadn't really posted that to suggest you should comment it out, but if doing so helps you, it at least gives a clearer indication of what the problem is... You probably have two exit() functions defined! One in stdlib.h, and one someplace else. http://www.opengl.org/discussion_boards/ubb/smile.gif