Jump to content

Minesweeper Error fails compile


KevinA

Recommended Posts

Just tried the PI setup, Hello World worked with a couple of warnings but when I attempped to compile minesweeper  I got:

Compiling ../resources/ugfx/src/ginput/ginput_mouse.c
../resources/ugfx/src/ginput/ginput_mouse.c: In function '_gmouseInitDriver':
../resources/ugfx/src/ginput/ginput_mouse.c:693:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (!gmvmt(m)->init((GMouse *)g, driverinstance))
     ^~
../resources/ugfx/src/ginput/ginput_mouse.c:697:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
  if (!gtimerIsActive(&MouseTimer))
  ^~
../resources/ugfx/src/ginput/ginput_mouse.c: In function 'ginputCalibrateMouse':
../resources/ugfx/src/ginput/ginput_mouse.c:814:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
         if (!(gmvmt(m)->d.flags & GMOUSE_VFLG_CALIBRATE))
         ^~
../resources/ugfx/src/ginput/ginput_mouse.c:817:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
   return CalibrateMouse(m);
   ^~~~~~
Compiling ../resources/ugfx/src/ginput/ginput_keyboard.c
Compiling ../resources/ugfx/src/ginput/ginput_keyboard_microcode.c
Compiling ../resources/ugfx/src/ginput/ginput_toggle.c
Compiling ../resources/ugfx/src/ginput/ginput_dial.c
Compiling ../resources/ugfx/src/gadc/gadc.c
Compiling ../resources/ugfx/src/gaudio/gaudio.c
Compiling ../resources/ugfx/src/gmisc/gmisc.c
Compiling ../resources/ugfx/src/gmisc/gmisc_arrayops.c
Compiling ../resources/ugfx/src/gmisc/gmisc_matrix2d.c
Compiling ../resources/ugfx/src/gmisc/gmisc_trig.c
Compiling ../resources/ugfx/src/gmisc/gmisc_hittest.c
Compiling ../resources/ugfx/src/gfile/gfile.c
Compiling ../resources/ugfx/src/gfile/gfile_fs_native.c
Compiling ../resources/ugfx/src/gfile/gfile_fs_ram.c
Compiling ../resources/ugfx/src/gfile/gfile_fs_rom.c
Compiling ../resources/ugfx/src/gfile/gfile_fs_fatfs.c
Compiling ../resources/ugfx/src/gfile/gfile_fs_petitfs.c
Compiling ../resources/ugfx/src/gfile/gfile_fs_mem.c
Compiling ../resources/ugfx/src/gfile/gfile_fs_chibios.c
Compiling ../resources/ugfx/src/gfile/gfile_fs_strings.c
Compiling ../resources/ugfx/src/gfile/gfile_printg.c
Compiling ../resources/ugfx/src/gfile/gfile_scang.c
Compiling ../resources/ugfx/src/gfile/gfile_stdio.c
Compiling ../resources/ugfx/src/gfile/gfile_fatfs_wrapper.c
Compiling ../resources/ugfx/src/gfile/gfile_fatfs_diskio_chibios.c
Compiling ../resources/ugfx/src/gfile/gfile_petitfs_wrapper.c
Compiling ../resources/ugfx/src/gfile/gfile_petitfs_diskio_chibios.c
Compiling ../resources/ugfx/src/gtrans/gtrans.c
Compiling ../resources/ugfx/drivers/gdisp/framebuffer/gdisp_lld_framebuffer.c
Compiling ../resources/ugfx/demos/games/minesweeper/main.c
Compiling ../resources/ugfx/demos/games/minesweeper/mines.c
Linking .build/minesweeper
/tmp/ccG3KGFl.ltrans2.ltrans.o: In function `_gmouseInit':
<artificial>:(.text+0x17c0): undefined reference to `GMOUSEVMT_OnlyOne'
/tmp/ccG3KGFl.ltrans9.ltrans.o: In function `gdispGFillArc':
<artificial>:(.text+0x70): undefined reference to `cos'
<artificial>:(.text+0xbc): undefined reference to `sin'
<artificial>:(.text+0xd4): undefined reference to `floor'
<artificial>:(.text+0x114): undefined reference to `cos'
<artificial>:(.text+0x160): undefined reference to `sin'
<artificial>:(.text+0x178): undefined reference to `floor'
/tmp/ccG3KGFl.ltrans10.ltrans.o: In function `gdispGDrawThickArc':
<artificial>:(.text+0x1f0): undefined reference to `tan'
<artificial>:(.text+0x29c): undefined reference to `tan'
<artificial>:(.text+0x37c): undefined reference to `tan'
<artificial>:(.text+0x428): undefined reference to `tan'
/tmp/ccG3KGFl.ltrans11.ltrans.o: In function `gdispGDrawArc':
<artificial>:(.text+0xd84): undefined reference to `sin'
<artificial>:(.text+0xdb0): undefined reference to `cos'
<artificial>:(.text+0xdc8): undefined reference to `floor'
<artificial>:(.text+0xe18): undefined reference to `sin'
<artificial>:(.text+0xe64): undefined reference to `cos'
<artificial>:(.text+0xe7c): undefined reference to `floor'
collect2: error: ld returned 1 exit status
../resources/ugfx/tools/gmake_scripts/compiler_gcc.mk:298: recipe for target '.build/minesweeper' failed
make: *** [.build/minesweeper] Error 1

NOTE: I do not have the 7" display with a touch screen, the PI Zero W is running on an HDMI monitor with a Logitech K400+ keyboard.

Is there a means to set input to the keyboard tablet?

Link to comment
Share on other sites

There appear to be 2 things it is complaining about...

1. It is missing the math library. Add -lm to the link line.

2. It appears you have turned on mouse support but have not included a mouse driver.

The raspberry pi uses the standard Linux event device if running in framebuffer mode, or the X input driver if running in X mode.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...