473,471 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

unusual error with same code on different systems

3 New Member
Hello,

though this code uses opengl library freeglut,the problem seems to be c++ related..kindly help. and all coding is done in c++

when i try to execute the code,i get this error

freeglut ERROR: Function <glutBitmapCharacter> called without first
calling 'glutInit'.

the thing of concern is that the same code runs fine on one system
with RHEL4 and on the other with RHEL4 the error is produced...

on ubuntu too at home i get the same error...

On systems where the said error is produced,if i comment out all
the lines that use the glutBitmapCharacter function....the code runs
fine on them aswell but this isnt a solution at all...because the
"glutinit not called first" error should come here aswell as other
glut functions are being still used(if the compiler is fair
enough)...and as one can see the glutInit function is being called at
the right place in the main function..
(for,those who dont have opengl coding experience--before one can use any draw functions of glut library,some initial modes and Init methods are to be setup...that is being done correctly,believe me! as all other opengl programs are running successfully.)

the code given here is only the main() part...

and when the said runtime error is produced,even the first cout also is not printed on the terminal...which means the control isnt going into main()???
Does anyone have any clue about this??

Help is appreciated.

Thanks,
Regards.

here is the main() code:::

Expand|Select|Wrap|Line Numbers
  1. int main (int argc, char** argv)
  2. {
  3.     cout<<"\n\nHIHIHIHIHIHI\n\n";
  4.     int stat=0;
  5.     int b;
  6.     pid_t pID;
  7.  
  8.     pID = fork();
  9.  
  10.     if(pID==0){
  11.         printf("pID zero %d\n",pID);
  12.         execl("/bin/sh","/bin/sh","-c","./noutput",0);
  13. #ifdef __abc__
  14.         execl("/usr/bin/bash","/usr/bin/bash","-c","./noutput",0);
  15. #else
  16.         execl("/bin/bash","/bin/bash","-c","./noutput",0);
  17. #endif
  18.  
  19.     }
  20.  
  21.     else if(pID>0){
  22.         printf("pID not zero %d\n",pID);
  23.         glutInit(&argc,argv);
  24.         glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB);
  25.  
  26.         glutInitWindowSize(1600,1200);
  27.         glutInitWindowPosition(0,0);
  28.  
  29.         glutCreateWindow();
  30.  
  31.         init();
  32.         createMenu();
  33.  
  34.         glutDisplayFunc(display);
  35.         glutReshapeFunc(reshape);
  36.         glutIdleFunc(display);
  37.  
  38.         glutKeyboardFunc(sampleKeyFunc);
  39.         glutMouseFunc(mouseClick);
  40.         glutMotionFunc(mouseMoveActive);
  41.         glutPassiveMotionFunc(mouseMovePassive);
  42.         glutMainLoop();
  43.  
  44.     }
  45.     else
  46.         printf("error in child process");
  47.  
  48.     return 0;
  49.  
Mar 3 '08 #1
1 1992
JonLT
41 New Member
Are you feeding the program the right command line arguments?
Mar 6 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
7
by: William S Fulton | last post by:
I'm looking for the name of the following casting style in order to do some reading around on it and why it is sometimes used. unsigned long long ull = 0; void * ptr = 0; ull = *(unsigned...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.