This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problem with cygwin and GLUT on Vista


Michael McGuffin  wrote:

> Hello,

Hello Michael,

> I'm using cygwin on Vista, 

Which version? 32-bit or 64-bit? with or without SP1?

> and have a problem running C++ code that contains calls to 
> GLUT routines. I've isolated the problem down to a very simple piece of code, and have 
> searched the web without being able to find help.
> 
> Note that I have packages opengl 1.1.0-8, freeglut 2.4.0-1, and gcc-g++ 3.4.4-3, 
> and "uname -a" outputs
> CYGWIN_NT-6.0 opticon-w 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin

The standard (and more complete) way to provide that information is to attach the output of 
cygcheck -s to your problem report.

Please note that there is currently a conflict between the opengl package and the libglut-devel
package. If you have both, you will have to uninstall one of them. See:
http://cygwin.com/ml/cygwin/2008-11/msg00033.html

> Here's the problem, as best as I can isolate it. If I create a file called main.cpp containing 
> the following code:
> 
> 
> #include 
> #include 
> 
> 
> int main( int argc, char *argv[] ) {
>   if ( argc> 100 ) {
>     // glutInit( &argc, argv );
>      glClear(GL_COLOR_BUFFER_BIT);
>   }
>   char str[100];
>   printf("Enter a string:");
>   scanf("%s",str);
> }
> and then I compile it with
> 
> g++ -o main main.cpp -lm -lglut32 -lglu32 -lopengl32

This is just plain C, not C++. Can you rename it main.c and recompile with:

gcc -o main main.cpp -lglut32 -lglu32 -lopengl32

This would clear-up if it is an issue with the stdc++ library.

> and then run the code without any arguments, it runs fine (note that the call to glClear() 
> never happens). However, if I uncomment the call to the glutInit() routine and comment the
> glClear() call,
> 
> 
> #include 
> #include 
> 
> 
> int main( int argc, char *argv[] ) {
>   if ( argc> 100 ) {
>      glutInit( &argc, argv );
>      // glClear(GL_COLOR_BUFFER_BIT);
>   }
>   char str[100];
>   printf("Enter a string:");
>   scanf("%s",str);
> }
> 
> and compile the same way and run again without any arguments, Windows Vista gives me> an error message with the following details:
> 
> 
> Nom d'événement de problème:            APPCRASH
> Nom de l'application:                   main.exe
> Version de l'application:               0.0.0.0
> Horodatage de l'application:            49103229
> Nom du module par défaut:               ntdll.dll
> Version du module par défaut:           6.0.6001.18000
> Version du module par défaut:           4791a7a6
> Code de l'exception:                    c0000022
> Décalage de l'exception:                00009cac
> Version du système:                     6.0.6001.2.1.0.256.4
> Identificateur de paramètres régionaux: 3084
> etc.

Your example compiles and runs fine for me under XP SP3.

> 
> Note, again, that the call to glutInit() never happens. I suspect that simply linking with GLUT> somehow causes a problem, perhaps in some initialization of GLUT.
> 

Then try one of the precompiled examples. What happens if you run
/usr/lib/glui-examples/example6 ?

> Note that I have tried running the main.exe as "administrator" (by right clicking on 
> main.exe and choosing the "run as administrator" option from the right-click menu), and I 
> get the same error message as when I try running main.exe from a cygwin shell prompt.
> 
> Any help would be appreciated, thanks.

I don't have a Vista machine with Cygwin installed right now. It might take a week before I 
get one. When I do, I will report back here.

Regards,

- André Bleau, Cygwin's volunteer OpenGL package maintainer.

Please direct any question or comment about the OpenGL package to cygwin at cygwin dot com




_________________________________________________________________


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]