-
C code working in Linux but not in Windows
hey there
i just loaded my C code i have been working on in linux into my home visual 6 studio and i cant get my code to compile
i have set up the linking properly and it finds gl.h and the definition for typedef int GLint;
but it says that 'GLint CirclePoints = 60;'
is an illegal use of this type as an expression
if anyone could help me that would be great
-
Advanced Member
Frequent Contributor
Re: C code working in Linux but not in Windows
I've never seen the like. Where is that expression located: GLint CirclePoints = 60 ?
-
Re: C code working in Linux but not in Windows
#include <Gl\glut.h>
#include <math.h>
#define PI 3.14159
void display(void)
{
int i = 0;
float angle;
/* clear window */
glClear(GL_COLOR_BUFFER_BIT);
GLint CirclePoints = 60;
etc......
if you need more info i can post the whole program..also i am a newbie at openGl so go easy
-
Advanced Member
Frequent Contributor
Re: C code working in Linux but not in Windows
I'll bet that your header is not visible from your source file.
-
Advanced Member
Frequent Contributor
Re: C code working in Linux but not in Windows
Don't forget this:
#include <GL/gl.h>
-
Re: C code working in Linux but not in Windows
hey there portal
i loaded my code onto a web page because i still cant get it working
have a look at it at www.geocities.com/bernief_1982/index.html
cheers
-
Advanced Member
Frequent Contributor
Re: C code working in Linux but not in Windows
If the compiler is complaining about an undefined type, then you know what the problem is: it can't see the header - it's that simple.
GLint, and all the other basic GL types are defined in gl.h.
edit:
try this:
#include <windows.h>
#include <GL\gl.h>
#include <GL\glut.h>
-
Re: C code working in Linux but not in Windows
the compiler is just complaining about an illegal use of the type
it finds the definition in gl.h fine but still doesnt like the code
thats the problem im having
-
Advanced Member
Frequent Contributor
Re: C code working in Linux but not in Windows
Bernie_82, if there's something wrong with your code, it's not immediately obvious to me what it is. What exactly is the compiler telling you?
-
Re: C code working in Linux but not in Windows
This is exactly what its telling me.
You can see how it finds the declaration of GLint
thats why i find it weird that it wont work
C:\main.c(13) : error C2275: 'GLint' : illegal use of this type as an expression
d:\program files\microsoft visual studio\vc98\include\gl\gl.h(48) : see declaration of 'GLint'
C:\main.c(13) : error C2146: syntax error : missing ';' before identifier 'CirclePoints'
C:\main.c(13) : error C2065: 'CirclePoints' : undeclared identifier
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules