473,732 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ 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 <glutBitmapChar acter> 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 glutBitmapChara cter 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,belie ve 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...whic h 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 2014
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
4750
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 appreciated. Thanks in advance
6
2770
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 appreciated. Thanks in advance
669
26075
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 paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
7
2648
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 long long*)&ptr; As opposed to the more usual casting:
0
8946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9447
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9235
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
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, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.