0

make button ยป error: use of undeclared identifier 'GButton'

jharvard@appliance (~/Dropbox/pset3): make button
clang -ggdb3 -O0 -std=c99 -Wall -Werror    button.c  -lcs50 -lm -o button
button.c:12:5: error: use of undeclared identifier 'GButton'
GButton button = newGButton("Button");
^
button.c:13:5: error: implicit declaration of function 'setActionCommand' is invalid in C99
  [-Werror,-Wimplicit-function-declaration]
setActionCommand(button, "click");
^
button.c:13:5: note: did you mean 'getActionCommand'?
/usr/include/spl/gevents.h:365:8: note: 'getActionCommand' declared here
string getActionCommand(void *arg);
   ^
button.c:13:22: error: use of undeclared identifier 'button'
setActionCommand(button, "click");
                 ^
button.c:15:5: error: implicit declaration of function 'setToRegion' is invalid in C99
  [-Werror,-Wimplicit-function-declaration]
setToRegion(window, button, "SOUTH");
^
button.c:15:5: note: did you mean 'addToRegion'?
/usr/include/spl/gwindow.h:315:6: note: 'addToRegion' declared here
void addToRegion(GWindow gw, GObject gobj, string region);
 ^
button.c:15:25: error: use of undeclared identifier 'button'
setToRegion(window, button, "SOUTH");
                    ^
5 errors generated.
make: *** [button] Error 1
jharvard@appliance (~/Dropbox/pset3): 

What am I doing wrong now :/ ?

5
  • 1
    Did you include spl/ginteractors.h?
    – kzidane
    Mar 21, 2015 at 6:56
  • did now; doesnt make a difference, though.
    – daniel
    Mar 26, 2015 at 23:36
  • Not sure if you're still getting the exact same errors, but you need to link the SPL as well as the math library with the -lcs -lm clang options. See the last paragraph of this answer for an easy way!
    – kzidane
    Mar 27, 2015 at 1:48
  • clang -ggdb3 -O0 -std=c99 -Wall -Werror -Wno-unused-variable -o button button.c -Lspl/lib -lcs -lm » Like this, correct? Tried that also.
    – daniel
    Mar 28, 2015 at 9:34
  • Depends on the version of the appliance. If appliance 2014, then -lcs and -lm is enough.
    – kzidane
    Mar 28, 2015 at 10:53

0

You must log in to answer this question.

Browse other questions tagged .