Compilation fails following instructions

Issue #267 resolved
José María Miotto created an issue

I tried to install the game as descripted in the instructions, but I get an error, it seems that my system doesn't recognize the SDL library. Below I post the full log of the cmake:


System is Linux Note: SDL audio is enabled (default)

FREETYPE_INCLUDE_DIR is/home/chuse/Games/caesaria/dep/freetype -- Looking for include file stdio.h -- Looking for include file stdio.h - found -- Looking for include file inttypes.h -- Looking for include file inttypes.h - found -- Looking for include file sys/filio.h -- Looking for include file sys/filio.h - not found -- Looking for include file sys/ioctl.h -- Looking for include file sys/ioctl.h - found -- Looking for include file sys/param.h -- Looking for include file sys/param.h - found -- Looking for include file sys/poll.h -- Looking for include file sys/poll.h - found -- Looking for include file sys/resource.h -- Looking for include file sys/resource.h - found -- Looking for include file sys/select.h -- Looking for include file sys/select.h - found -- Looking for include file sys/socket.h -- Looking for include file sys/socket.h - found -- Looking for include file sys/socket.h -- Looking for include file sys/socket.h - found -- Looking for include file sys/sockio.h -- Looking for include file sys/sockio.h - not found -- Looking for include file sys/stat.h -- Looking for include file sys/stat.h - found -- Looking for include file sys/time.h -- Looking for include file sys/time.h - found -- Looking for include file sys/types.h -- Looking for include file sys/types.h - found -- Looking for include file sys/uio.h -- Looking for include file sys/uio.h - found -- Looking for include file sys/un.h -- Looking for include file sys/un.h - found -- Looking for include file sys/utime.h -- Looking for include file sys/utime.h - not found -- Looking for include file alloca.h -- Looking for include file alloca.h - found -- Looking for include file arpa/inet.h -- Looking for include file arpa/inet.h - found -- Looking for include file arpa/tftp.h -- Looking for include file arpa/tftp.h - found -- Looking for include file assert.h -- Looking for include file assert.h - found -- Looking for include file crypto.h -- Looking for include file crypto.h - not found -- Looking for include file des.h -- Looking for include file des.h - not found -- Looking for include file err.h -- Looking for include file err.h - found -- Looking for include file errno.h -- Looking for include file errno.h - found -- Looking for include file fcntl.h -- Looking for include file fcntl.h - found -- Looking for include file gssapi/gssapi.h -- Looking for include file gssapi/gssapi.h - not found -- Looking for include file gssapi/gssapi_generic.h -- Looking for include file gssapi/gssapi_generic.h - not found -- Looking for include file gssapi/gssapi_krb5.h -- Looking for include file gssapi/gssapi_krb5.h - not found -- Looking for include file idn-free.h -- Looking for include file idn-free.h - not found -- Looking for include file ifaddrs.h -- Looking for include file ifaddrs.h - found -- Looking for include file io.h -- Looking for include file io.h - not found -- Looking for include file krb.h -- Looking for include file krb.h - not found -- Looking for include file libgen.h -- Looking for include file libgen.h - found -- Looking for include file libssh2.h -- Looking for include file libssh2.h - not found -- Looking for include file limits.h -- Looking for include file limits.h - found -- Looking for include file locale.h -- Looking for include file locale.h - found -- Looking for include file net/if.h -- Looking for include file net/if.h - found -- Looking for include file netdb.h -- Looking for include file netdb.h - found -- Looking for include file netinet/in.h -- Looking for include file netinet/in.h - found -- Looking for include file netinet/tcp.h -- Looking for include file netinet/tcp.h - found -- Looking for include file pem.h -- Looking for include file pem.h - not found -- Looking for include file poll.h -- Looking for include file poll.h - found -- Looking for include file pwd.h -- Looking for include file pwd.h - found -- Looking for include file rsa.h -- Looking for include file rsa.h - not found -- Looking for include file setjmp.h -- Looking for include file setjmp.h - found -- Looking for include file sgtty.h -- Looking for include file sgtty.h - found -- Looking for include file signal.h -- Looking for include file signal.h - found -- Looking for include file ssl.h -- Looking for include file ssl.h - not found -- Looking for include file stdbool.h -- Looking for include file stdbool.h - found -- Looking for include file stdbool.h -- Looking for include file stdbool.h - found -- Looking for include file stdint.h -- Looking for include file stdint.h - found -- Looking for include file stdlib.h -- Looking for include file stdlib.h - found -- Looking for include file string.h -- Looking for include file string.h - found -- Looking for include file strings.h -- Looking for include file strings.h - found -- Looking for include file stropts.h -- Looking for include file stropts.h - found -- Looking for include file termio.h -- Looking for include file termio.h - found -- Looking for include file termios.h -- Looking for include file termios.h - found -- Looking for include file time.h -- Looking for include file time.h - found -- Looking for include file tld.h -- Looking for include file tld.h - not found -- Looking for include file unistd.h -- Looking for include file unistd.h - found -- Looking for include file utime.h -- Looking for include file utime.h - found -- Looking for include file x509.h -- Looking for include file x509.h - not found -- Looking for include file process.h -- Looking for include file process.h - not found -- Looking for include file stddef.h -- Looking for include file stddef.h - found -- Looking for include file dlfcn.h -- Looking for include file dlfcn.h - found -- Looking for include file malloc.h -- Looking for include file malloc.h - found -- Looking for include file memory.h -- Looking for include file memory.h - found -- Looking for include file ldap.h -- Looking for include file ldap.h - not found -- Looking for include file netinet/if_ether.h -- Looking for include file netinet/if_ether.h - found -- Looking for include file sockio.h -- Looking for include file sockio.h - not found -- Looking for include file sys/utsname.h -- Looking for include file sys/utsname.h - found -- Looking for include file idna.h -- Looking for include file idna.h - not found -- Looking for include file poll.h -- Looking for include file poll.h - found 64 bits compiler detected

Building CaesarIA-game Git test

SDL2_INCLUDE_DIR is SDL2_INCLUDE_DIR-NOTFOUND -- Looking for include file pthread.h -- Looking for include file pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
CMake Error at source/cmake/Modules/FindPackageHandleStandardArgs.cmake:97 (message): Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR) Call Stack (most recent call first): source/cmake/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE) source/cmake/Modules/FindSDL2.cmake:196 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) source/CMakeLists.txt:11 (find_package)

-- Configuring incomplete, errors occurred!

Comments (9)

  1. dalerank repo owner

    good day, what os???

    if ubuntu like you need install SDL2

    $sudo apt-get install libsdl2-dev

  2. José María Miotto reporter

    Hi! I have the latest ubuntu.

    In deed the sdl2 was missing, so I added it to the necessary dependencies in the wiki.

    Now I have a different error, in the compiler:

    chuse@chuse:~/Games/caesaria$ make [ 3%] Built target zlib [ 6%] Built target libpng [ 6%] Built target smk [ 7%] Built target aes [ 8%] Built target bzip2 [ 24%] Built target freetype Scanning dependencies of target ttf [ 24%] Building C object dep/ttf/CMakeFiles/ttf.dir/SDL_ttf.c.o /home/chuse/Games/caesaria/dep/ttf/SDL_ttf.c:34:17: fatal error: SDL.h: No such file or directory #include "SDL.h" ^ compilation terminated. make[2]: [dep/ttf/CMakeFiles/ttf.dir/SDL_ttf.c.o] Error 1 make[1]: [dep/ttf/CMakeFiles/ttf.dir/all] Error 2 make: *** [all] Error 2

  3. José María Miotto reporter

    notice that /usr/include/ doesn't have any SDL.h file, but there's a SDL and SDL2 folder; SDL has SDL.h, SDL_endian.h and SDL_ttf.h; SDL2 has only the first two.

  4. José María Miotto reporter

    if I change to #include "SDL/SDL.h", for those three includes, I get yet another error, this is why I wanted to know first what do you think...

  5. dalerank repo owner

    did you say cmake -DCMAKE_BUILD_TYPE=Debug ./ before make??? usually SDL2 install into /usr/include/SDL2, where your location of SDL2/SDL.h???

  6. José María Miotto reporter

    So, I changed the location, and I fixed the resulting error by installing libdsl2-ttf-dev. Now I have other errors anyway. I'll close this ticket.

  7. Log in to comment