#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    24
    Rep Power
    0

    Called object is not a function?


    Hello,

    I don't understand what is the wrong. In main i call a function left() and i have this error from Cygwin "main.c:31: error: called object is not a function " Can anybody help me?

    [
    Code:
    #include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdbool.h> #include "left.h" #include "rotation.h" #include "start.h" #include "up.h" #include "extern.h"   main() {       typedef struct {               int x ;               int y ;               }joystic;        	int swich;  	joystic right; 	joystic left ;                         swich=4; 	    right.x=100; 	    right.y=100; 	    left.y=100;             start(&swich); 	 //  printf("S=%i\n",s); 	   up(&right.x);  	   left(&right.y) ; 	     rotation(&left.y);        }
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,377
    Rep Power
    1871
    > Can anybody help me?
    Probably not.
    You've been at this for over 6 months, yet you still can't be bothered to review your post to make sure it is READABLE to everyone else before you rush to press that submit button.

    All on one line code => unreadable, and ignored post.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    24
    Rep Power
    0
    Sorry,

    Code:
    #include <stdio.h>
    #include <stdlib.h> 
    #include <math.h> 
    #include <stdbool.h> 
    #include "left.h" 
    #include "rotation.h" 
    #include "start.h" 
    #include "up.h" 
    #include "extern.h"   
    
    main() {       
    typedef struct {               
    int x ;               
    int y ;               
    }joystic;        	
    
    int swich;  
    joystic right; 	
    joystic left ;
                             
    swich=4; 	    
    right.x=100; 	    
    right.y=100; 	    
    left.y=100;             
    start(&swich); 	 
    //printf("S=%i\n",s); 	   
    up(&right.x);  	   
    left(&right.y) ; 	    
    rotation(&left.y);        
    }
  6. #4
  7. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,837
    Rep Power
    480
    This problem could be mine, but I'd swear there are 30 lines of code with error on line 31. I don't have these apparently joystick libraries and cannot help.
    [code]Code tags[/code] are essential for python code and Makefiles!
  8. #5
  9. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,377
    Rep Power
    1871
    > joystic left ;
    One kind of left.

    > left(&right.y) ;
    Another kind of left.

    Do you understand that 'left' is NOT a function.
    Hence the error message "error: called object is not a function "
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    24
    Rep Power
    0
    Thank you very much.You have absolutely right!!

IMN logo majestic logo threadwatch logo seochat tools logo