GLUT + Bc55

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?

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.

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”.

Originally posted by borlander:
[b]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?[/b]

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

from Ida

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();

Originally posted by Deiussum:
[b]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();[/b]

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

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.