Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: glu.h MinGW  (Read 10263 times)

0 Members and 2 Guests are viewing this topic.

lancel00t

  • Newbie
  • *
  • Posts: 18
    • ICQ Messenger - 449212638
    • AOL Instant Messenger - dripdropliner@ao
    • View Profile
    • http://www.watsontechgroup.com
glu.h MinGW
« on: September 20, 2007, 01:56:16 am »
It seems that glu.h with MinGW is also broke in this release of SFML V 1.1. Compiling opengl.cpp using default instructions does not work using MinGW. A failed compilation generates error messages from glu.h in addition to glBuild2DMipmaps and gluPerspective not being found, most likely because glu.h is broken in terms of it's implementation with SFML.

Thanks!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
glu.h MinGW
« Reply #1 on: September 20, 2007, 08:03:37 am »
It's not broken, in fact I just forgot to include glu.h (I removed it from glew.h and forgot to update the demos sources... shame on me). To get a portable include filename you can write this :
Code: [Select]
#include SFML_GLU_HEADER
Laurent Gomila - SFML developer

lancel00t

  • Newbie
  • *
  • Posts: 18
    • ICQ Messenger - 449212638
    • AOL Instant Messenger - dripdropliner@ao
    • View Profile
    • http://www.watsontechgroup.com
Not Working
« Reply #2 on: September 20, 2007, 06:59:40 pm »
Even after including #include SFML_GLU_HEADER appropriatley I get the following compiler output:
Code: [Select]

Running "C:\msys\1.0\bin\make.exe  -f Makefile CONF=Debug" in C:\Users\Robert\Application_1

/usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/Users/Robert/Application_1'
mkdir -p build/Debug/MinGW-Windows
g++.exe    -c -g3 -gdwarf-2 -IC\:/MinGW/include -IC\:/msys/1.0/local/include -o build/Debug/MinGW-Windows/newfile.o newfile.cc
In file included from newfile.cc:8:

C:/MinGW/include/GL/glu.h:225: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:225: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:226: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:226: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:227: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:227: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:228: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:228: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:229: error: `GLAPI' does not name a type

C:/MinGW/include/GL/glu.h:230: error: `GLAPI' does not name a type

C:/MinGW/include/GL/glu.h:231: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:231: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:232: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:232: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:233: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:233: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:234: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:234: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:235: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:235: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:236: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:236: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:237: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:237: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:238: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:238: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:239: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:239: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:240: error: expected constructor, destructor, or type conversion before "const"

C:/MinGW/include/GL/glu.h:240: error: expected `,' or `;' before "const"

C:/MinGW/include/GL/glu.h:241: error: expected constructor, destructor, or type conversion before "const"

C:/MinGW/include/GL/glu.h:241: error: expected `,' or `;' before "const"

C:/MinGW/include/GL/glu.h:242: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:242: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:243: error: expected constructor, destructor, or type conversion before "const"

C:/MinGW/include/GL/glu.h:243: error: expected `,' or `;' before "const"

C:/MinGW/include/GL/glu.h:244: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:244: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:245: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:245: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:246: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:246: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:247: error: `GLAPI' does not name a type

C:/MinGW/include/GL/glu.h:248: error: `GLAPI' does not name a type

C:/MinGW/include/GL/glu.h:249: error: `GLAPI' does not name a type

C:/MinGW/include/GL/glu.h:250: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:250: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:251: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:251: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:252: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:252: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:253: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:253: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:254: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:254: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:255: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:255: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:256: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:256: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:257: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:257: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:258: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:258: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:259: error: `GLAPI' does not name a type

C:/MinGW/include/GL/glu.h:260: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:260: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:261: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:261: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:262: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:262: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:263: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:263: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:264: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:264: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:265: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:265: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:266: error: `GLAPI' does not name a type

C:/MinGW/include/GL/glu.h:267: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:267: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:268: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:268: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:269: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:269: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:270: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:270: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:271: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:271: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:272: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:272: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:273: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:273: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:274: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:274: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:275: error: expected constructor, destructor, or type conversion before "void"

C:/MinGW/include/GL/glu.h:275: error: expected `,' or `;' before "void"

C:/MinGW/include/GL/glu.h:276: error: `GLAPI' does not name a type

C:/MinGW/include/GL/glu.h:277: error: `GLAPI' does not name a type

newfile.cc: In function `int main()':

newfile.cc:39: error: `gluBuild2DMipmaps' undeclared (first use this function)

newfile.cc:39: error: (Each undeclared identifier is reported only once for each function it appears in.)

newfile.cc:81: error: `gluPerspective' undeclared (first use this function)

make[1]: *** [build/Debug/MinGW-Windows/newfile.o] Error 1
make[1]: Leaving directory `/c/Users/Robert/Application_1'
make: *** [.build-impl] Error 2

Build failed. Exit value 2.


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
glu.h MinGW
« Reply #3 on: September 20, 2007, 09:12:41 pm »
Do you include it before the SFML headers ? It should be after, because in Windows the GL / GLU headers first need windows.h to be included (which is done by the SFML headers).
Laurent Gomila - SFML developer

lancel00t

  • Newbie
  • *
  • Posts: 18
    • ICQ Messenger - 449212638
    • AOL Instant Messenger - dripdropliner@ao
    • View Profile
    • http://www.watsontechgroup.com
SFML_GLU_HEADER
« Reply #4 on: September 20, 2007, 10:20:00 pm »
It does not work either way; placing before or after.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
glu.h MinGW
« Reply #5 on: September 21, 2007, 08:36:40 am »
Hmm... Is this GLU header working in a project not using SFML ?
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
glu.h MinGW
« Reply #6 on: September 21, 2007, 09:07:47 am »
Sorry, this was my fault.

In fact, I removed the glu.h include from glew.h (to avoid unnecessary compile errors for people who don't have GLU installed), but glew.h then removes the Windows-specific macros needed for glu.h. To fix it, you need to comment this code at the end of SFML/Window/glew/glew.h :

Code: [Select]
#ifdef GLEW_APIENTRY_DEFINED
#undef GLEW_APIENTRY_DEFINED
#undef APIENTRY
#undef GLAPIENTRY
#endif

#ifdef GLEW_CALLBACK_DEFINED
#undef GLEW_CALLBACK_DEFINED
#undef CALLBACK
#endif

#ifdef GLEW_WINGDIAPI_DEFINED
#undef GLEW_WINGDIAPI_DEFINED
#undef WINGDIAPI
#endif

#undef GLAPI
Laurent Gomila - SFML developer

lancel00t

  • Newbie
  • *
  • Posts: 18
    • ICQ Messenger - 449212638
    • AOL Instant Messenger - dripdropliner@ao
    • View Profile
    • http://www.watsontechgroup.com
Many thanks.
« Reply #7 on: September 21, 2007, 10:46:25 pm »
Thanks Laurent!

NickZA

  • Newbie
  • *
  • Posts: 2
    • View Profile
Having problems with this.
« Reply #8 on: April 13, 2008, 10:12:32 pm »
Hi

Be gentle with me here, I'm lost as to how to get this going. Laurent, when you said to include
Code: [Select]
#include SFML_GLU_HEADER

Do you mean directly after
Code: [Select]
#include <SFML/Window.hpp>
?


(I made the change as above, also commented out the lines you mentioned in glew.h, but no go)

Did I have to change anything else like including glew.h in main.cpp, or changing anything else in my build settings, environment settings etc.?


Please help. I would really like to try out this library.  :?

Thanks,

-Nick

Build log follows:


-------------- Build: Debug in CB_SFML_test ---------------

Compiling: main.cpp
Linking console executable: bin\Debug\CB_SFML_test.exe
obj\Debug\main.o: In function `main':
E:/GameProj/CB_SFML_test/main.cpp:21: undefined reference to `__imp___ZN2sf9VideoModeC1Ejjj'
E:/GameProj/CB_SFML_test/main.cpp:21: undefined reference to `__imp___ZN2sf6WindowC1ENS_9VideoModeERKSsmi'
E:/GameProj/CB_SFML_test/main.cpp:27: undefined reference to `_glClearDepth@8'
E:/GameProj/CB_SFML_test/main.cpp:28: undefined reference to `_glClearColor@16'
E:/GameProj/CB_SFML_test/main.cpp:31: undefined reference to `_glEnable@4'
E:/GameProj/CB_SFML_test/main.cpp:32: undefined reference to `_glDepthMask@4'
E:/GameProj/CB_SFML_test/main.cpp:35: undefined reference to `_glMatrixMode@4'
E:/GameProj/CB_SFML_test/main.cpp:36: undefined reference to `_glLoadIdentity@0'
E:/GameProj/CB_SFML_test/main.cpp:37: undefined reference to `_gluPerspective@32'
E:/GameProj/CB_SFML_test/main.cpp:45: undefined reference to `__imp___ZN2sf6Window8GetEventERNS_5EventE'
E:/GameProj/CB_SFML_test/main.cpp:57: undefined reference to `_glViewport@16'
E:/GameProj/CB_SFML_test/main.cpp:63: undefined reference to `__imp___ZNK2sf6Window10SetCurrentEv'
E:/GameProj/CB_SFML_test/main.cpp:66: undefined reference to `_glClear@4'
E:/GameProj/CB_SFML_test/main.cpp:69: undefined reference to `_glMatrixMode@4'
E:/GameProj/CB_SFML_test/main.cpp:70: undefined reference to `_glLoadIdentity@0'
E:/GameProj/CB_SFML_test/main.cpp:71: undefined reference to `_glTranslatef@12'
E:/GameProj/CB_SFML_test/main.cpp:72: undefined reference to `_glRotatef@16'
E:/GameProj/CB_SFML_test/main.cpp:73: undefined reference to `_glRotatef@16'
E:/GameProj/CB_SFML_test/main.cpp:74: undefined reference to `_glRotatef@16'
E:/GameProj/CB_SFML_test/main.cpp:77: undefined reference to `_glBegin@4'
E:/GameProj/CB_SFML_test/main.cpp:79: undefined reference to `_glVertex3f@12'
E:/GameProj/CB_SFML_test/main.cpp:80: undefined reference to `_glVertex3f@12'
E:/GameProj/CB_SFML_test/main.cpp:81: undefined reference to `_glVertex3f@12'
E:/GameProj/CB_SFML_test/main.cpp:82: undefined reference to `_glVertex3f@12'
E:/GameProj/CB_SFML_test/main.cpp:84: undefined reference to `_glVertex3f@12'
obj\Debug\main.o:E:/GameProj/CB_SFML_test/main.cpp:85: more undefined references to `_glVertex3f@12' follow
obj\Debug\main.o: In function `main':
E:/GameProj/CB_SFML_test/main.cpp:109: undefined reference to `_glEnd@0'
E:/GameProj/CB_SFML_test/main.cpp:112: undefined reference to `__imp___ZN2sf6Window7DisplayEv'
E:/GameProj/CB_SFML_test/main.cpp:115: undefined reference to `sf::Window::~Window()'
E:/GameProj/CB_SFML_test/main.cpp:115: undefined reference to `sf::Window::~Window()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
30 errors, 0 warnings

NickZA

  • Newbie
  • *
  • Posts: 2
    • View Profile
glu.h MinGW
« Reply #9 on: April 13, 2008, 11:23:39 pm »
:oops: right, okay, I hadn't included all libs in my compiler/linker settings... ahem.

I have it compiling, but when it attempts to run it returns with error code 1.... The window flicks out within about a 1/4 second of it appearing.

Any help would be appreciated.

-Nick