#1 Le 13/09/2020, à 18:39
- sterastos
[resolu]Faire fonctionner mon makefile
bonjour
je suis dans l'apprentissage de C avec SDL.
mon programme ne compile pas j'ai beaucoup lue et chercher mais rien ne vas
voici mon makefile (le dernier en date)
# Makefile pour le programme sdl_cc
CC = gcc
COPTS = -c -O3 -W -Wall -Werror -pedantic
sdl_premier.x : sdl_premier.o
${CC} sdl_premier.o -o sdl_premier.x `pkg-config --libs --cflags sdl`
sdl_premier.o : sdl_premier.c
${CC} ${COPTS} sdl_premier.c
purge :
rm -f *~ *.o *.x
le début de mon programme
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <SDL/SDL.h>
le message de compilation:
make -k
gcc -c -O3 -W -Wall -Werror -pedantic sdl_premier.c
sdl_premier.c:4:10: fatal error: SDL/SDL.h: Aucun fichier ou dossier de ce type
4 | #include <SDL/SDL.h>
| ^~~~~~~~~~~
compilation terminated.
make: *** [makefile:11 : sdl_premier.o] Erreur 1
make: La cible « sdl_premier.x » n'a pas été refabriquée à cause d'erreurs.
je programme avec imacs et je lance la compilation avec lui
petite idée ?
Dernière modification par sterastos (Le 13/09/2020, à 20:42)
Ubuntu 18.04.1 LTS passer au 20.04.01 LTS automatiquement
Gnome 3.36.3
Intel Core i5-8250U
Intel UHD Graphics 620
Hors ligne
#2 Le 13/09/2020, à 19:38
- pingouinux
Re : [resolu]Faire fonctionner mon makefile
Bonsoir,
Tu pourrais déjà vérifier le retour de cette commande (extraite de ton makefile) :
pkg-config --libs --cflags sdl
Hors ligne
#3 Le 13/09/2020, à 20:14
- sterastos
Re : [resolu]Faire fonctionner mon makefile
arf j'ai pas de paquet sdl
Package sdl was not found in the pkg-config search path.
Perhaps you should add the directory containing `sdl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sdl' found
j'ai trouver aussi cela a mettre dans le make (pas bon non plus)
-lSDL -lSDL_mixe
je suis allé voir mon usr/include
aio.h cursesapp.h etip.h gettext-po.h lastlog.h mcheck.h netinet poll.h scsi syscall.h ulimit.h
aliases.h cursesf.h execinfo.h GL libgen.h memory.h netipx printf.h search.h sysexits.h unctrl.h
alloca.h curses.h expat_external.h glob.h libintl.h menu.h netiucv proc_service.h semaphore.h syslog.h unistd.h
argp.h cursesm.h expat.h gnumake.h libltdl misc netpacket protocols sensors tar.h utime.h
argz.h cursesp.h fcntl.h gnu-versions.h libpng mlocate netrom pthread.h setjmp.h tcpd.h utmp.h
ar.h cursesw.h features.h grp.h libpng16 mntent.h netrose pty.h sgtty.h termcap.h utmpx.h
arpa cursslk.h fenv.h gshadow.h libudev.h monetary.h net-snmp pwd.h shadow.h term_entry.h values.h
asm-generic dbus-1.0 finclude iconv.h libusb-1.0 mqueue.h nfs python2.7 signal.h term.h video
assert.h dirent.h fmtmsg.h ifaddrs.h limits.h mtd nl_types.h python3.8 sound termio.h wait.h
autosprintf.h dlfcn.h fnmatch.h inttypes.h link.h nc_tparm.h nss.h rdma spawn.h termios.h wchar.h
byteswap.h drm form.h iproute2 linux ncurses_dll.h numpy re_comp.h stab.h tgmath.h wctype.h
c++ elf.h fstab.h jbig85.h llvm-6.0 ncurses.h obstack.h regex.h stdc-predef.h thread_db.h wordexp.h
clang emacs-module.h fts.h jbig_ar.h llvm-c-6.0 ncursesw openssl regexp.h stdint.h threads.h X11
complex.h endian.h ftw.h jbig.h locale.h net openvpn reglib stdio_ext.h tic.h x86_64-linux-gnu
cpio.h envz.h gawkapi.h jerror.h ltdl.h netash panel.h resolv.h stdio.h time.h xcb
crypt.h err.h gcalc-2 jmorecfg.h lzma netatalk paths.h rpc stdlib.h ttyent.h xen
ctype.h errno.h gci-2 jpegint.h lzma.h netax25 pngconf.h rpcsvc string.h ucd-snmp xorg
cups error.h gconv.h jpeglib.h malloc.h netdb.h png.h sane strings.h uchar.h zconf.h
cupsfilters eti.h getopt.h langinfo.h math.h neteconet pnglibconf.h sched.h sudo_plugin.h ucontext.h zlib.h
je ne trouve pas de sdl dedant si il est bien la
Dernière modification par sterastos (Le 13/09/2020, à 20:26)
Ubuntu 18.04.1 LTS passer au 20.04.01 LTS automatiquement
Gnome 3.36.3
Intel Core i5-8250U
Intel UHD Graphics 620
Hors ligne
#4 Le 13/09/2020, à 20:32
- sterastos
Re : [resolu]Faire fonctionner mon makefile
le paquet libsdl1.2debian est installer
Ubuntu 18.04.1 LTS passer au 20.04.01 LTS automatiquement
Gnome 3.36.3
Intel Core i5-8250U
Intel UHD Graphics 620
Hors ligne
#5 Le 13/09/2020, à 20:42
- sterastos
Re : [resolu]Faire fonctionner mon makefile
trouver en j'ai installé libsdl1.2-dev
Ubuntu 18.04.1 LTS passer au 20.04.01 LTS automatiquement
Gnome 3.36.3
Intel Core i5-8250U
Intel UHD Graphics 620
Hors ligne
#6 Le 14/09/2020, à 05:36
- NicoApi73
Re : [resolu]Faire fonctionner mon makefile
Bonjour,
La SDL actuellement disponible est la 2.0.12 https://www.libsdl.org/download-2.0.php, qu'il faut compiler pour pouvoir l'utiliser.
Attention, les API sont différentes entre la 1.2 et la 2.0
Hors ligne