PDA

View Full Version : Compile error on VC++ 6



eagon17
01-30-2001, 10:17 PM
I'm trying to compile a UNIX based code on my PC(Win98/Visual C++ 6). I get the following error msg.

____________________________________
\Work\testfield\assignment4.c(176) : error C2152: 'function' : pointers to functions with different attributes
______________________________________

and the line 176 is as follows
_____________________________________

auxExposeFunc(reshape);
_______________________________________

The code compiles fine on UNIX.
What do I need to do to resolve this problem?

thasmin
02-01-2001, 05:37 AM
If you're using VC++, you might want to try turning off Microsoft Language Extensions if you're porting code from Unix. Go to Project, Settings, C++. In the drop down bow choose Customize and check Disable Language Extensions.

Elixer
02-01-2001, 10:46 AM
How is auxExposeFunc() defined, and how is reshape defined?

eagon17
02-01-2001, 01:51 PM
Originally posted by Elixer:
How is auxExposeFunc() defined, and how is reshape defined?



It's one of the glaux library function.

eagon17
02-01-2001, 01:56 PM
Originally posted by thasmin:
If you're using VC++, you might want to try turning off Microsoft Language Extensions if you're porting code from Unix. Go to Project, Settings, C++. In the drop down bow choose Customize and check Disable Language Extensions.

Thanks. I will try that and see what happens.

Deiussum
02-02-2001, 09:12 AM
From glAux.h



typedef void (CALLBACK* AUXEXPOSEPROC)(int, int);
void APIENTRY auxExposeFunc(AUXEXPOSEPROC);


Is your reshape defined like so?...




void reshape(int x, int y);


If you're using unsigned ints instead of ints, then your function definition won't match the function that auxExposeFunc is looking for.