JulNadeauCA / libagar

Cross-Platform GUI Toolkit (stable)
https://libagar.org/
BSD 2-Clause "Simplified" License
376 stars 40 forks source link

Installing failing on linux #80

Closed arjunmenon closed 3 weeks ago

arjunmenon commented 1 month ago

Hey, unable to install this. I am on linux mint from a VM. Configure logs without any flags

$: ./configure 
BSDBuild 3.2 <https://bsdbuild.hypertriton.com/>
* Overwriting existing Makefile.config
    _       _       _     ___
  / _ \   / _ \   / _ \  |  _ \
 | |_| | | (_| | | |_| | | |_) |
 |_| |_|  \__, | |_| |_| |_| |_|
          |___/                 
                 v1.7.0 for x86_64 (LARGE)

checking for a C compiler...yes, /usr/bin/clang
checking whether the C compiler works...yes
cc: checking whether compiler is Clang...yes
cc: checking whether compiler is cc65...no
cc: checking whether compiler is emcc...no
cc: checking whether compiler is GCC...no
cc: checking for compiler warning options...yes
cc: checking for float and double...yes
cc: checking for long double...yes
cc: checking for long long...yes
checking for Objective-C compiler...yes, /usr/bin/clang
checking whether the Objective-C compiler works...yes
objc: checking for compiler warning options...yes
checking for byte order...little-endian
checking for C compiler attributes...aligned bounded const deprecated format
checking for C compiler attributes...malloc noreturn packed pure unused
checking for C compiler attributes...warn_unused_result 
checking for <sys/types.h>...yes
checking for <stdint.h>...yes
checking for int64_t type...yes
checking for __int64 type...no
checking for <sys/stat.h>...yes
checking for <stdlib.h>...yes
checking for <unistd.h>...yes
checking for compatible <limits.h>...yes
checking for <float.h>...yes
checking for the C math library...yes
checking for the C math library (C99)...yes
checking for a fdclose() function...no
checking for getpwuid()...yes
checking for the getpwnam_r() interface...yes
checking for getenv()...yes
checking for getuid()...yes
checking for strsep()...yes
checking for asprintf()...yes
checking for snprintf()...yes
checking for vsnprintf()...yes
checking for vasprintf()...yes
checking for ANSI-style signal() facilities...yes
checking for strtoll()...yes
checking for strtold()...yes
checking for dlopen() interface...yes
checking for dyld interface...no
checking for the shl_load() interface...no
checking for gettimeofday()...yes
checking for the select() interface...yes
checking for glob()...yes
checking for the getopt() function...yes
checking for the execvp() function...yes
checking for clock_gettime() interface (w/o -lrt)...yes
checking for winmm time interface...no
checking for nanosleep()...yes
checking for the kqueue() mechanism...no
checking for the Linux timerfd interface...yes
checking for Windows CSIDL...no
checking for the Xbox XDK...no
checking for mprotect()...yes
checking for SDL 2.0...yes (2.0.20)
checking whether SDL2 works...yes
checking for OpenGL...yes
checking whether OpenGL works...yes
checking whether OpenGL has glext...yes
checking for the X window system...yes
checking for the XKB extension...yes
checking for the Xinerama extension...yes
checking for the Cocoa framework...no
checking for the GLX interface...yes
checking for the WGL interface...no
checking for FreeType...yes (24.1.18)
checking whether FreeType works...yes
checking for fontconfig...yes (2.13.1)
checking whether fontconfig works...yes
checking for libjpeg...yes
checking whether libjpeg works...yes
checking for libpng...yes (1.6.37)
checking whether libpng works...yes
checking for getaddrinfo()...yes
checking for the SIOCGIFCONF interface...yes
checking for setsockopt()...yes
checking for SO_OOBINLINE...yes
checking for SO_REUSEPORT...yes
checking for SO_TIMESTAMP...yes
checking for SO_NOSIGPIPE...no
checking for SO_LINGER...yes
checking for SO_ACCEPTFILTER...no
checking for WinSock...not checking
checking for POSIX threads...yes
checking for the X/Open Threads Extension...yes
checking for PTHREAD_MUTEX_RECURSIVE...yes
checking for PTHREAD_MUTEX_RECURSIVE_NP...yes
checking whether pthread_mutex_t is a pointer...no
checking whether pthread_cond_t is a pointer...no
checking whether pthread_t is a pointer...yes
checking for AltiVec (with <altivec.h>)...no
checking for AltiVec (without <altivec.h>)...no
checking for SSE extensions...yes
checking for SSE2 extensions...yes
checking for SSE3 extensions...yes
checking for GLU...yes
preprocessing header files...done
**
** Configuration successful!
**
** Use "make depend all" to compile. When finished,
** run "make install" to install under /usr/local.
**

Make output (truncated only to error)

/usr/bin/clang -D_AGAR_INTERNAL -D_DEFAULT_SOURCE -D_BSD_SOURCE  -I/home/am/Documents/gui/agar-1.7.0/include -U_XOPEN_SOURCE -D_XOPEN_SOURCE=600         -I/usr/include -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16    -I/usr/include -I/usr/include/libpng16   -D_AGAR_GUI_INTERNAL  -fPIC -o drv_sdl2mw.o -c drv_sdl2mw.c
drv_sdl2mw.c:155:16: error: use of undeclared identifier 'SDL_HINT_MOUSE_AUTO_CAPTURE'
                        SDL_SetHint(SDL_HINT_MOUSE_AUTO_CAPTURE, "0");
                                    ^
drv_sdl2mw.c:757:15: error: use of undeclared identifier 'SDL_HINT_MOUSE_AUTO_CAPTURE'
                SDL_SetHint(SDL_HINT_MOUSE_AUTO_CAPTURE, "0");
                            ^
drv_sdl2mw.c:759:3: warning: implicit declaration of function 'SDL_ResetHint' is invalid in C99 [-Wimplicit-function-declaration]
                SDL_ResetHint(SDL_HINT_MOUSE_AUTO_CAPTURE);
                ^
drv_sdl2mw.c:759:17: error: use of undeclared identifier 'SDL_HINT_MOUSE_AUTO_CAPTURE'; did you mean 'SDL_WINDOW_MOUSE_CAPTURE'?
                SDL_ResetHint(SDL_HINT_MOUSE_AUTO_CAPTURE);
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                              SDL_WINDOW_MOUSE_CAPTURE
/usr/include/SDL2/SDL_video.h:120:5: note: 'SDL_WINDOW_MOUSE_CAPTURE' declared here
    SDL_WINDOW_MOUSE_CAPTURE    = 0x00004000,   /**< window has mouse captured (unrelated to MOUSE_GRABBED) */
    ^
drv_sdl2mw.c:761:15: error: use of undeclared identifier 'SDL_HINT_MOUSE_AUTO_CAPTURE'
                SDL_SetHint(SDL_HINT_MOUSE_AUTO_CAPTURE, "1");
                            ^
1 warning and 4 errors generated.
*
* drv_sdl2mw.o compilation failed.
*
make[2]: *** [../mk/build.lib.mk:140: drv_sdl2mw.o] Error 1
make[2]: Leaving directory '/home/am/Documents/gui/agar-1.7.0/gui'
make: failure
make[1]: *** [../mk/build.lib.mk:277: _lib_objs] Error 1
make[1]: Leaving directory '/home/am/Documents/gui/agar-1.7.0/gui'
make: *** [mk/build.subdir.mk:32: all-subdir] Error 1

I also tried to run configure using --with-x to just use x11. But I get the same output. How to install this properly?

JulNadeauCA commented 4 weeks ago

Could you try updating your version of SDL2 to 2.0.22 or later?

I'll add a version check to the ./configure test so it will output a more helpful error message in this case.

If you don't need the SDL2 drivers, you can also pass --without-sdl2.

arjunmenon commented 4 weeks ago

It seems to be on the correct version

$: dpkg -l | grep sdl
ii  libsdl2-2.0-0:amd64                        2.0.20+dfsg-2ubuntu1.22.04.1                       amd64        Simple DirectMedia Layer
ii  libsdl2-dev:amd64                          2.0.20+dfsg-2ubuntu1.22.04.1                       amd64        Simple DirectMedia Layer development files

I installed it from the package manager itself.

JulNadeauCA commented 4 weeks ago

That's a very outdated version (more than 2 years old). The latest is SDL 2.30.2. I'd recommend that you download SDL from libsdl.org, compile and install it from source.

You may also want to contact the maintainer of that libsdl2 package and see why they're distributing such an old version.

We could always #ifdef the bit of code that uses SDL_HINT_MOUSE_AUTO_CAPTURE on our end, but I don't really want to do that since AG_Menu relies on it for proper behavior of popup menus in multi-window settings.

arjunmenon commented 4 weeks ago

Got it. Let me try that out. Thanks.

arjunmenon commented 3 weeks ago

Hey, built sdl from source. I was able to run this. Thanks for your support.